Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afffe0d1 authored by Denis Plotnikov's avatar Denis Plotnikov Committed by Greg Kroah-Hartman
Browse files

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: 7e2cf4fe ("qlcnic: change driver hardware interface mechanism")
Signed-off-by: default avatarDenis Plotnikov <den-plotnikov@yandex-team.ru>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a841f6a0
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -629,7 +629,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;
	}