Skip to content

Commit

Permalink
ice: Fix a NULL vs IS_ERR() check in probe()
Browse files Browse the repository at this point in the history
The ice_allocate_sf() function returns error pointers on error.  It
doesn't return NULL.  Update the check to match.

Fixes: 177ef7f ("ice: base subfunction aux driver")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Dan Carpenter authored and kuba-moo committed Sep 15, 2024
1 parent 7583457 commit 472d455
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_sf_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ static int ice_sf_dev_probe(struct auxiliary_device *adev,
vsi->flags = ICE_VSI_FLAG_INIT;

priv = ice_allocate_sf(&adev->dev, pf);
if (!priv) {
if (IS_ERR(priv)) {
dev_err(dev, "Subfunction devlink alloc failed");
return -ENOMEM;
return PTR_ERR(priv);
}

priv->dev = sf_dev;
Expand Down

0 comments on commit 472d455

Please sign in to comment.