]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: Fix potential netpoll crash
authorMatt Carlson <mcarlson@broadcom.com>
Thu, 30 Sep 2010 10:34:30 +0000 (10:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Oct 2010 07:24:41 +0000 (00:24 -0700)
commit77fd2b44d48abb265f98a3d2399cc93f734c5b48
treedb289b3d2e73bc3a9f6dcb480911210046c0de07
parent850312824c5f2c49aeb2bee13696b0cb1935001a
tg3: Fix potential netpoll crash

Up until now the tg3 driver would call netif_napi_add() for the maximum
number of NAPI instances the driver could use.  The problem is that
netpoll could call tg3_poll() on instances that are not active.  The net
effect is that the driver will crash attempting to dereference
uninitialized pointers.

The fix is to only allocate as many NAPI instances as the driver would
use in tg3_open() and deleted them in tg3_close().

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c