summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-09-14 12:57:28 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-15 08:30:21 -0700
commit75834577c0870c9087274f015887b6f4106b3a24 (patch)
tree431fead3defd86c77bfd3005eb3a4171f1b96867 /drivers
parentc209847b8974d2d5e784e3105d4683835673b18d (diff)
downloadlinux-stable-75834577c0870c9087274f015887b6f4106b3a24.tar.gz
linux-stable-75834577c0870c9087274f015887b6f4106b3a24.tar.bz2
linux-stable-75834577c0870c9087274f015887b6f4106b3a24.zip
ice: Fix a couple NULL vs IS_ERR() bugs
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> Link: https://patch.msgid.link/7f7aeb91-8771-47b8-9275-9d9f64f947dd@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_repr.c8
1 files 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;