Skip to contentSkip to conversation

netxen: do_rom_fast_write error handling

PATCH Applied Stephen Hemminger 3 participants 3 messages Feb 26, 2007 – Feb 27, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netxen: do_rom_fast_write error handling

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.

---
 drivers/net/netxen/netxen_nic_init.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/netxen/netxen_nic_init.c +4 -1
@@ -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;
 
#1 lore raw

Ah.. missed that.
Thanks.
-Amit

Quoted 26 lines · Stephen Hemminger

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.

---
 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 @@

drivers/net/netxen/netxen_nic_init.c +4 -1
 		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;
Applied
#2 lore raw
In reply to Stephen Hemminger
Quoted 10 lines · Stephen Hemminger

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.

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

applied