Skip to content

Commit 472d455

Browse files
Dan Carpenterkuba-moo
authored andcommitted
ice: Fix a NULL vs IS_ERR() check in probe()
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]>
1 parent 7583457 commit 472d455

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/ice/ice_sf_eth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ static int ice_sf_dev_probe(struct auxiliary_device *adev,
108108
vsi->flags = ICE_VSI_FLAG_INIT;
109109

110110
priv = ice_allocate_sf(&adev->dev, pf);
111-
if (!priv) {
111+
if (IS_ERR(priv)) {
112112
dev_err(dev, "Subfunction devlink alloc failed");
113-
return -ENOMEM;
113+
return PTR_ERR(priv);
114114
}
115115

116116
priv->dev = sf_dev;

0 commit comments

Comments
 (0)