Commit 472d455e authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

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: 177ef7f1 ("ice: base subfunction aux driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/6951d217-ac06-4482-a35d-15d757fd90a3@stanley.mountainSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 75834577
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment