public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ice: Fix a NULL vs IS_ERR() check in probe()
@ 2024-09-14  9:57 Dan Carpenter
  2024-09-14 15:35 ` Simon Horman
  2024-09-15 16:01 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-09-14  9:57 UTC (permalink / raw)
  To: Piotr Raczynski
  Cc: Tony Nguyen, Przemek Kitszel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Jiri Pirko,
	Michal Swiatkowski, intel-wired-lan, netdev, linux-kernel,
	kernel-janitors

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-15 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14  9:57 [PATCH net-next] ice: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
2024-09-14 15:35 ` Simon Horman
2024-09-15 16:01 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox