Skip to content

Commit 7573099

Browse files
den-plotnikovdavem330
authored andcommitted
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: 7e2cf4f ("qlcnic: change driver hardware interface mechanism") Signed-off-by: Denis Plotnikov <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Bjorn Helgaas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent adacf21 commit 7573099

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,13 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)
628628
int i, err, ring;
629629

630630
if (dev->flags & QLCNIC_NEED_FLR) {
631-
pci_reset_function(dev->pdev);
631+
err = pci_reset_function(dev->pdev);
632+
if (err) {
633+
dev_err(&dev->pdev->dev,
634+
"Adapter reset failed (%d). Please reboot\n",
635+
err);
636+
return err;
637+
}
632638
dev->flags &= ~QLCNIC_NEED_FLR;
633639
}
634640

0 commit comments

Comments
 (0)