[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <6951d217-ac06-4482-a35d-15d757fd90a3@stanley.mountain>
Date: Sat, 14 Sep 2024 12:57:56 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Piotr Raczynski <piotr.raczynski@...el.com>
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Jiri Pirko <jiri@...nulli.us>,
Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH net-next] 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@...aro.org>
---
drivers/net/ethernet/intel/ice/ice_sf_eth.c | 4 ++--
1 file 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;
--
2.45.2
Powered by blists - more mailing lists