aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
diff options
context:
space:
mode:
authorSantosh Nayak <santoshprasadnayak@gmail.com>2012-06-20 00:52:58 +0000
committerDavid S. Miller <davem@davemloft.net>2012-06-25 15:26:31 -0700
commited3b856b69a7f3748d6917e42d462c962aaa39b8 (patch)
treedf7f508631f7db235b07c685274241f9055c7069 /drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
parentnetxen: Error return off by one in 'netxen_nic_set_pauseparam()'. (diff)
downloadlinux-dev-ed3b856b69a7f3748d6917e42d462c962aaa39b8.tar.xz
linux-dev-ed3b856b69a7f3748d6917e42d462c962aaa39b8.zip
netxen: Error return off by one for XG port.
There are NETXEN_NIU_MAX_XG_PORTS ports. Port indexing starts from zero. Hence we should also return error for 'port == NETXEN_NIU_MAX_XG_PORTS'. Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Diffstat (limited to 'drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c')
-rw-r--r--drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index d4f179f96dcb..9103e3e36c28 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -511,7 +511,7 @@ netxen_nic_get_pauseparam(struct net_device *dev,
break;
}
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
- if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS))
+ if ((port < 0) || (port >= NETXEN_NIU_MAX_XG_PORTS))
return;
pause->rx_pause = 1;
val = NXRD32(adapter, NETXEN_NIU_XG_PAUSE_CTL);
@@ -577,7 +577,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
}
NXWR32(adapter, NETXEN_NIU_GB_PAUSE_CTL, val);
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
- if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS))
+ if ((port < 0) || (port >= NETXEN_NIU_MAX_XG_PORTS))
return -EIO;
val = NXRD32(adapter, NETXEN_NIU_XG_PAUSE_CTL);
if (port == 0) {