diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-05-05 15:20:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-07 21:15:32 +0200 |
commit | 8c1f454625743d60763a23c58fa65681d3c98b6f (patch) | |
tree | 98a4a7824818469c17d1a09573c3a63d4f3d4e3a /drivers | |
parent | netxen: reversed condition in netxen_nic_set_link_parameters() (diff) | |
download | linux-8c1f454625743d60763a23c58fa65681d3c98b6f.tar.xz linux-8c1f454625743d60763a23c58fa65681d3c98b6f.zip |
netxen: netxen_rom_fast_read() doesn't return -1
The error handling is broken here. netxen_rom_fast_read() returns zero
on success and -EIO on error. It never returns -1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index fd362b6923f4..9c6eed9b45f7 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c @@ -852,7 +852,8 @@ netxen_check_options(struct netxen_adapter *adapter) ptr32 = (__le32 *)&serial_num; offset = NX_FW_SERIAL_NUM_OFFSET; for (i = 0; i < 8; i++) { - if (netxen_rom_fast_read(adapter, offset, &val) == -1) { + err = netxen_rom_fast_read(adapter, offset, &val); + if (err) { dev_err(&pdev->dev, "error reading board info\n"); adapter->driver_mismatch = 1; return; |