netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: "Amit S. Kale" <amitkale@netxen.com>, Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH] netxen: do_rom_fast_write error handling
Date: Mon, 26 Feb 2007 14:51:56 -0800	[thread overview]
Message-ID: <20070226145156.5c0424a3@freekitty> (raw)

Compiler warning spots real error!

The function do_rom_fast_read called in do_rom_fast_write can fail
and leave data1 unset. This causes a compile warning.  
The correct thing is to propagate the error out.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/netxen/netxen_nic_init.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- pktgen.orig/drivers/net/netxen/netxen_nic_init.c	2007-02-26 14:45:46.000000000 -0800
+++ pktgen/drivers/net/netxen/netxen_nic_init.c	2007-02-26 14:46:37.000000000 -0800
@@ -499,7 +499,10 @@
 		while(1) {
 			int data1;
 
-			do_rom_fast_read(adapter, addridx, &data1);
+			ret = do_rom_fast_read(adapter, addridx, &data1);
+			if (ret < 0)
+				return ret;
+
 			if (data1 == data)
 				break;
 

             reply	other threads:[~2007-02-26 22:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26 22:51 Stephen Hemminger [this message]
2007-02-27  6:41 ` [PATCH] netxen: do_rom_fast_write error handling Amit Kale
2007-02-27  9:39 ` Jeff Garzik

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=20070226145156.5c0424a3@freekitty \
    --to=shemminger@linux-foundation.org \
    --cc=amitkale@netxen.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).