[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c6acd223945669c3c0229afc62b1890810da8145.1632420431.git.leonro@nvidia.com>
Date: Thu, 23 Sep 2021 21:12:53 +0300
From: Leon Romanovsky <leon@...nel.org>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Leon Romanovsky <leonro@...dia.com>,
Alexander Lobakin <alobakin@...me>,
Anirudh Venkataramanan <anirudh.venkataramanan@...el.com>,
Ariel Elior <aelior@...vell.com>,
GR-everest-linux-l2@...vell.com,
GR-QLogic-Storage-Upstream@...vell.com,
Igor Russkikh <irusskikh@...vell.com>,
intel-wired-lan@...ts.osuosl.org,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Javed Hasan <jhasan@...vell.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Jiri Pirko <jiri@...dia.com>, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Michael Chan <michael.chan@...adcom.com>,
Michal Kalderon <michal.kalderon@...vell.com>,
netdev@...r.kernel.org, Sathya Perla <sathya.perla@...adcom.com>,
Saurav Kashyap <skashyap@...vell.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Subject: [PATCH net-next 6/6] qed: Don't ignore devlink allocation failures
From: Leon Romanovsky <leonro@...dia.com>
devlink is a software interface that doesn't depend on any hardware
capabilities. The failure in SW means memory issues, wrong parameters,
programmer error e.t.c.
Like any other such interface in the kernel, the returned status of
devlink APIs should be checked and propagated further and not ignored.
Fixes: 755f982bb1ff ("qed/qede: make devlink survive recovery")
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 12 +++++-------
drivers/scsi/qedf/qedf_main.c | 2 ++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 9837bdb89cd4..ee4c3bd28a93 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1176,19 +1176,17 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
edev->devlink = qed_ops->common->devlink_register(cdev);
if (IS_ERR(edev->devlink)) {
DP_NOTICE(edev, "Cannot register devlink\n");
+ rc = PTR_ERR(edev->devlink);
edev->devlink = NULL;
- /* Go on, we can live without devlink */
+ goto err3;
}
} else {
struct net_device *ndev = pci_get_drvdata(pdev);
+ struct qed_devlink *qdl;
edev = netdev_priv(ndev);
-
- if (edev->devlink) {
- struct qed_devlink *qdl = devlink_priv(edev->devlink);
-
- qdl->cdev = cdev;
- }
+ qdl = devlink_priv(edev->devlink);
+ qdl->cdev = cdev;
edev->cdev = cdev;
memset(&edev->stats, 0, sizeof(edev->stats));
memcpy(&edev->dev_info, &dev_info, sizeof(dev_info));
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 42d0d941dba5..94ee08fab46a 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3416,7 +3416,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
qedf->devlink = qed_ops->common->devlink_register(qedf->cdev);
if (IS_ERR(qedf->devlink)) {
QEDF_ERR(&qedf->dbg_ctx, "Cannot register devlink\n");
+ rc = PTR_ERR(qedf->devlink);
qedf->devlink = NULL;
+ goto err2;
}
}
--
2.31.1
Powered by blists - more mailing lists