summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-09-14 12:57:56 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-15 08:32:16 -0700
commit472d455e7c6f32e6ae4738de8e6ba212db372661 (patch)
tree96620067cb044a00e256bb40d67559da09fa20e0 /drivers/net/ethernet
parent75834577c0870c9087274f015887b6f4106b3a24 (diff)
downloadlwn-472d455e7c6f32e6ae4738de8e6ba212db372661.tar.gz
lwn-472d455e7c6f32e6ae4738de8e6ba212db372661.zip
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 <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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_sf_eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.c b/drivers/net/ethernet/intel/ice/ice_sf_eth.c
index d00389c405c4..75d7147e1c01 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;