ice: Fix a NULL vs IS_ERR() check in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 14 Sep 2024 09:57:56 +0000 (12:57 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sun, 15 Sep 2024 15:32:16 +0000 (08:32 -0700)
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 <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/6951d217-ac06-4482-a35d-15d757fd90a3@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/ice/ice_sf_eth.c

index d00389c405c45078605fbef426eb3fd02d048d4a..75d7147e1c01c0311bb6182ec326830313168f55 100644 (file)
@@ -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;