]> git.baikalelectronics.ru Git - kernel.git/commit
[TG3]: Fix possible NULL deref in tg3_run_loopback().
authorJesper Juhl <jesper.juhl@gmail.com>
Wed, 10 May 2006 06:14:35 +0000 (23:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 May 2006 06:14:35 +0000 (23:14 -0700)
commit0e93fde609dbe799926abe0a07b9d0daf3860096
treef741922e4dbc4920548d7d4b68cf5eb37c11f85e
parent0f6e5c3fa2ef2c57025d4e10c69bb1eb40770090
[TG3]: Fix possible NULL deref in tg3_run_loopback().

tg3_run_loopback doesn't check that dev_alloc_skb() returns anything
useful.

Even if dev_alloc_skb() fails to return an skb to us we'll happily go
on and assume it did, so we risk dereferencing a NULL pointer.  Much
better to fail gracefully by returning -ENOMEM than crashing here.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c