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:09:42 +0000 (09:09 -0800)
commita72e06f5ed0af18baecee57adf2659583de8cdbf
tree5c47a7b650c04f7e13905931e175569b9cbfdf93
parentc556ebe8c839cdf2f4e03d5daab4f9d0df35d935
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