summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Plotnikov <den-plotnikov@yandex-team.ru>2023-04-07 10:18:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-20 12:10:26 +0200
commitdad92d8ada07f1a700d7ac83358e1682d6f98f9e (patch)
treee18872a4cb3cd980569054567e78f766ec1eb1e9
parent4a519731ece83d0884fa12595206f1d12f7fe4e5 (diff)
downloadlinux-stable-dad92d8ada07f1a700d7ac83358e1682d6f98f9e.tar.gz
linux-stable-dad92d8ada07f1a700d7ac83358e1682d6f98f9e.tar.bz2
linux-stable-dad92d8ada07f1a700d7ac83358e1682d6f98f9e.zip
qlcnic: check pci_reset_function result
[ Upstream commit 7573099e10ca69c3be33995c1fcd0d241226816d ] Static code analyzer complains to unchecked return value. The result of pci_reset_function() is unchecked. Despite, the issue is on the FLR supported code path and in that case reset can be done with pcie_flr(), the patch uses less invasive approach by adding the result check of pci_reset_function(). Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 7e2cf4feba05 ("qlcnic: change driver hardware interface mechanism") Signed-off-by: Denis Plotnikov <den-plotnikov@yandex-team.ru> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 87f76bac2e46..eb827b86ecae 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -628,7 +628,13 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)
int i, err, ring;
if (dev->flags & QLCNIC_NEED_FLR) {
- pci_reset_function(dev->pdev);
+ err = pci_reset_function(dev->pdev);
+ if (err) {
+ dev_err(&dev->pdev->dev,
+ "Adapter reset failed (%d). Please reboot\n",
+ err);
+ return err;
+ }
dev->flags &= ~QLCNIC_NEED_FLR;
}