Skip to content

Commit

Permalink
qlcnic: check pci_reset_function result
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
den-plotnikov authored and davem330 committed Apr 12, 2023
1 parent adacf21 commit 7573099
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7573099

Please sign in to comment.