mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
qlcnic: check pci_reset_function result
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: 7e2cf4feba
("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>
This commit is contained in:
parent
adacf21f1c
commit
7573099e10
1 changed files with 7 additions and 1 deletions
|
@ -628,7 +628,13 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)
|
||||||
int i, err, ring;
|
int i, err, ring;
|
||||||
|
|
||||||
if (dev->flags & QLCNIC_NEED_FLR) {
|
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;
|
dev->flags &= ~QLCNIC_NEED_FLR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue