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: 977514fb0f ("ice: create port representor for SF")
Fixes: 415db8399d ("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>
This commit is contained in:
Dan Carpenter 2024-09-14 12:57:28 +03:00 committed by Jakub Kicinski
parent c209847b89
commit 75834577c0

View File

@ -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;