Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[BNX2]: check return of dev_alloc_skb in bnx2_test_loopback

Check return of dev_alloc_skb in bnx2_test_loopback, and handle
appropriately.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

John W. Linville and committed by
David S. Miller
b6cbc3b6 2f23c523

+2
+2
drivers/net/bnx2.c
··· 3903 3903 3904 3904 pkt_size = 1514; 3905 3905 skb = dev_alloc_skb(pkt_size); 3906 + if (!skb) 3907 + return -ENOMEM; 3906 3908 packet = skb_put(skb, pkt_size); 3907 3909 memcpy(packet, bp->mac_addr, 6); 3908 3910 memset(packet + 6, 0x0, 8);