Skip to content

Commit

Permalink
netxen: do_rom_fast_write error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Feb 27, 2007
1 parent 36c843d commit f8dfdd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f8dfdd5

Please sign in to comment.