Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6cbc3b6 authored by John W. Linville's avatar John W. Linville Committed by David S. Miller
Browse files

[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: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2f23c523
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp)

	pkt_size = 1514;
	skb = dev_alloc_skb(pkt_size);
	if (!skb)
		return -ENOMEM;
	packet = skb_put(skb, pkt_size);
	memcpy(packet, bp->mac_addr, 6);
	memset(packet + 6, 0x0, 8);