netxen: do_rom_fast_write error handling
authorStephen Hemminger <shemminger@linux-foundation.org>
Mon, 26 Feb 2007 22:51:56 +0000 (14:51 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 27 Feb 2007 09:38:33 +0000 (04:38 -0500)
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>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/netxen/netxen_nic_init.c

index 2f324366784d9e9a3509dddb56bb1864d423e6ba..2f965701a95bcf62fcc5e598502ec9ae6ca332f8 100644 (file)
@@ -499,7 +499,10 @@ static inline int do_rom_fast_write_words(struct netxen_adapter *adapter,
                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;