tg3: fix ring init when there are more TX than RX channels
authorThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Tue, 25 Nov 2014 16:21:11 +0000 (14:21 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Dec 2014 17:37:09 +0000 (09:37 -0800)
commit600ce1de64e617a14055d1848afcfc9719d070ed
tree538a11d4571ed7666f8ad0b49d704ab262e7c1d2
parent077465adaffd3558a42717c178332be9ecbf9510
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>
drivers/net/ethernet/broadcom/tg3.c