* [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs
@ 2024-09-14 9:57 Dan Carpenter
2024-09-14 15:33 ` Simon Horman
2024-09-15 16:01 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-09-14 9:57 UTC (permalink / raw)
To: Michal Swiatkowski
Cc: Tony Nguyen, Przemek Kitszel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Wojciech Drewek,
intel-wired-lan, netdev, linux-kernel, kernel-janitors
The ice_repr_create() function returns error pointers. It never returns
NULL. Fix the callers to check for IS_ERR().
Fixes: 977514fb0fa8 ("ice: create port representor for SF")
Fixes: 415db8399d06 ("ice: make representor code generic")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/net/ethernet/intel/ice/ice_repr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index 00d4a9125dfa..970a99a52bf1 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -452,8 +452,8 @@ struct ice_repr *ice_repr_create_vf(struct ice_vf *vf)
return ERR_PTR(-EINVAL);
repr = ice_repr_create(vsi);
- if (!repr)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(repr))
+ return repr;
repr->type = ICE_REPR_TYPE_VF;
repr->vf = vf;
@@ -501,8 +501,8 @@ struct ice_repr *ice_repr_create_sf(struct ice_dynamic_port *sf)
{
struct ice_repr *repr = ice_repr_create(sf->vsi);
- if (!repr)
- return ERR_PTR(-ENOMEM);
+ if (IS_ERR(repr))
+ return repr;
repr->type = ICE_REPR_TYPE_SF;
repr->sf = sf;
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs
2024-09-14 9:57 [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs Dan Carpenter
@ 2024-09-14 15:33 ` Simon Horman
2024-09-15 16:01 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-09-14 15:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: Michal Swiatkowski, Tony Nguyen, Przemek Kitszel, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Wojciech Drewek,
intel-wired-lan, netdev, linux-kernel, kernel-janitors
On Sat, Sep 14, 2024 at 12:57:28PM +0300, Dan Carpenter wrote:
> The ice_repr_create() function returns error pointers. It never returns
> NULL. Fix the callers to check for IS_ERR().
>
> Fixes: 977514fb0fa8 ("ice: create port representor for SF")
> Fixes: 415db8399d06 ("ice: make representor code generic")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs
2024-09-14 9:57 [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs Dan Carpenter
2024-09-14 15:33 ` Simon Horman
@ 2024-09-15 16:01 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-15 16:01 UTC (permalink / raw)
To: Dan Carpenter
Cc: michal.swiatkowski, anthony.l.nguyen, przemyslaw.kitszel, davem,
edumazet, kuba, pabeni, horms, wojciech.drewek, intel-wired-lan,
netdev, linux-kernel, kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 14 Sep 2024 12:57:28 +0300 you wrote:
> The ice_repr_create() function returns error pointers. It never returns
> NULL. Fix the callers to check for IS_ERR().
>
> Fixes: 977514fb0fa8 ("ice: create port representor for SF")
> Fixes: 415db8399d06 ("ice: make representor code generic")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
>
> [...]
Here is the summary with links:
- [net-next] ice: Fix a couple NULL vs IS_ERR() bugs
https://git.kernel.org/netdev/net-next/c/75834577c087
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-15 16:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14 9:57 [PATCH net-next] ice: Fix a couple NULL vs IS_ERR() bugs Dan Carpenter
2024-09-14 15:33 ` Simon Horman
2024-09-15 16:01 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).