Skip to content

Commit b6cbc3b

Browse files
linvjwdavem330
authored andcommitted
[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>
1 parent 2f23c52 commit b6cbc3b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/net/bnx2.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp)
39033903

39043904
pkt_size = 1514;
39053905
skb = dev_alloc_skb(pkt_size);
3906+
if (!skb)
3907+
return -ENOMEM;
39063908
packet = skb_put(skb, pkt_size);
39073909
memcpy(packet, bp->mac_addr, 6);
39083910
memset(packet + 6, 0x0, 8);

0 commit comments

Comments
 (0)