netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qlcnic: check pci_reset_function result
@ 2023-03-31  8:06 Denis Plotnikov
  2023-03-31 17:52 ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Denis Plotnikov @ 2023-03-31  8:06 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, shshaikh, manishc, GR-Linux-NIC-Dev, davem,
	edumazet, kuba, pabeni, den-plotnikov

Static code analyzer complains to unchecked return value.
It seems that pci_reset_function return something meaningful
only if "reset_methods" is set.
Even if reset_methods isn't used check the return value to avoid
possible bugs leading to undefined behavior in the future.

Signed-off-by: Denis Plotnikov <den-plotnikov@yandex-team.ru>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 87f76bac2e463..39ecfc1a1dbd0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -628,7 +628,9 @@ 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 && err != -ENOTTY)
+			return err;
 		dev->flags &= ~QLCNIC_NEED_FLR;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-04-06 15:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31  8:06 [PATCH] qlcnic: check pci_reset_function result Denis Plotnikov
2023-03-31 17:52 ` Simon Horman
2023-04-03 10:58   ` Denis Plotnikov
2023-04-05 13:04     ` Simon Horman
2023-04-05 19:37       ` Bjorn Helgaas
2023-04-06  7:03         ` Simon Horman
2023-04-06  9:23           ` Denis Plotnikov
2023-04-06 11:43             ` Simon Horman
2023-04-06 12:42               ` Simon Horman
2023-04-06 15:06               ` Denis Plotnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).