mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: f.fainelli@gmail.com, pabeni@redhat.com, kuba@kernel.org,
	edumazet@google.com, davem@davemloft.net, klassert@kernel.org,
	Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] drivers/net/ethernet/3com: check the return value of vortex_up()
Date: Mon, 19 Sep 2022 00:36:31 -0700	[thread overview]
Message-ID: <20220919073631.1574577-1-floridsleeves@gmail.com> (raw)

Check the return value of vortex_up(), which could be error code when
the rx ring is not full.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 drivers/net/ethernet/3com/3c59x.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index ccf07667aa5e..7806c5f60ac8 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1942,6 +1942,7 @@ vortex_error(struct net_device *dev, int status)
 	void __iomem *ioaddr = vp->ioaddr;
 	int do_tx_reset = 0, reset_mask = 0;
 	unsigned char tx_status = 0;
+	int err;
 
 	if (vortex_debug > 2) {
 		pr_err("%s: vortex_error(), status=0x%x\n", dev->name, status);
@@ -2016,7 +2017,9 @@ vortex_error(struct net_device *dev, int status)
 			/* Must not enter D3 or we can't legally issue the reset! */
 			vortex_down(dev, 0);
 			issue_and_wait(dev, TotalReset | 0xff);
-			vortex_up(dev);		/* AKPM: bug.  vortex_up() assumes that the rx ring is full. It may not be. */
+			err = vortex_up(dev);
+			if (err)
+				return;
 		} else if (fifo_diag & 0x0400)
 			do_tx_reset = 1;
 		if (fifo_diag & 0x3000) {
-- 
2.25.1


             reply	other threads:[~2022-09-19  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  7:36 Li Zhong [this message]
2022-09-20 10:01 ` Steffen Klassert
2022-09-20 16:15   ` Li Zhong
2022-09-21  7:44     ` Steffen Klassert

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=20220919073631.1574577-1-floridsleeves@gmail.com \
    --to=floridsleeves@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=klassert@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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®