From: Stephen Hemminger Date: Mon, 26 Feb 2007 22:51:56 +0000 (-0800) Subject: netxen: do_rom_fast_write error handling X-Git-Tag: v2.6.21-rc2~3^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8dfdd5cab482a2ce4a8e2375e1512aa4829c653;p=linux-2.6 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. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 2f32436678..2f965701a9 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c @@ -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;