diff options
author | Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> | 2014-11-25 14:21:11 -0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-16 09:34:27 -0800 |
commit | dfe35fa73e531c9ce88d2fbdb5bd5716e9c190e6 (patch) | |
tree | 4afcd04472f93591375b0813d9b82e576d87ebe7 /drivers | |
parent | 1ea1f339310488810be0440e188024d466bbcccf (diff) | |
download | linux-stable-dfe35fa73e531c9ce88d2fbdb5bd5716e9c190e6.tar.gz linux-stable-dfe35fa73e531c9ce88d2fbdb5bd5716e9c190e6.tar.bz2 linux-stable-dfe35fa73e531c9ce88d2fbdb5bd5716e9c190e6.zip |
tg3: fix ring init when there are more TX than RX channels
[ Upstream commit a620a6bc1c94c22d6c312892be1e0ae171523125 ]
If TX channels are set to 4 and RX channels are set to less than 4,
using ethtool -L, the driver will try to initialize more RX channels
than it has allocated, causing an oops.
This fix only initializes the RX ring if it has been allocated.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 9373f1f59605..086eac5af5c2 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -8548,7 +8548,8 @@ static int tg3_init_rings(struct tg3 *tp) if (tnapi->rx_rcb) memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); - if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) { + if (tnapi->prodring.rx_std && + tg3_rx_prodring_alloc(tp, &tnapi->prodring)) { tg3_free_rings(tp); return -ENOMEM; } |