From: Denis Plotnikov <den-plotnikov@yandex-team.ru>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, shshaikh@marvell.com,
manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, den-plotnikov@yandex-team.ru
Subject: [PATCH] qlcnic: check pci_reset_function result
Date: Fri, 31 Mar 2023 11:06:05 +0300 [thread overview]
Message-ID: <20230331080605.42961-1-den-plotnikov@yandex-team.ru> (raw)
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
next reply other threads:[~2023-03-31 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-31 8:06 Denis Plotnikov [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230331080605.42961-1-den-plotnikov@yandex-team.ru \
--to=den-plotnikov@yandex-team.ru \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shshaikh@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®