diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index beeb612be98f2b2e9664b5a688ee40f8cb53a670..2bd9592b75cdde117ff50f1df7c2137bd467c808 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -8454,6 +8454,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) tx_len = 1514; skb = dev_alloc_skb(tx_len); + if (!skb) + return -ENOMEM; + tx_data = skb_put(skb, tx_len); memcpy(tx_data, tp->dev->dev_addr, 6); memset(tx_data + 6, 0x0, 8);