[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>

authored by Jesper Juhl and committed by David S. Miller a50bb7b9 8c105683

+3
+3
drivers/net/tg3.c
··· 8454 8454 8455 8455 tx_len = 1514; 8456 8456 skb = dev_alloc_skb(tx_len); 8457 + if (!skb) 8458 + return -ENOMEM; 8459 + 8457 8460 tx_data = skb_put(skb, tx_len); 8458 8461 memcpy(tx_data, tp->dev->dev_addr, 6); 8459 8462 memset(tx_data + 6, 0x0, 8);