Commit 75834577 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski
Browse files

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: 977514fb ("ice: create port representor for SF")
Fixes: 415db839 ("ice: make representor code generic")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/7f7aeb91-8771-47b8-9275-9d9f64f947dd@stanley.mountain


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c209847b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;