From: Dan Carpenter Date: Sat, 14 Sep 2024 09:57:56 +0000 (+0300) Subject: ice: Fix a NULL vs IS_ERR() check in probe() X-Git-Tag: v6.12-rc1~232^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=472d455e7c6f32e6ae4738de8e6ba212db372661;p=thirdparty%2Fkernel%2Flinux.git 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: 177ef7f1e2a0 ("ice: base subfunction aux driver") Signed-off-by: Dan Carpenter Reviewed-by: Simon Horman Link: https://patch.msgid.link/6951d217-ac06-4482-a35d-15d757fd90a3@stanley.mountain Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.c b/drivers/net/ethernet/intel/ice/ice_sf_eth.c index d00389c405c45..75d7147e1c01c 100644 --- a/drivers/net/ethernet/intel/ice/ice_sf_eth.c +++ b/drivers/net/ethernet/intel/ice/ice_sf_eth.c @@ -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;