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

[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
...@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp) ...@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp)
pkt_size = 1514; pkt_size = 1514;
skb = dev_alloc_skb(pkt_size); skb = dev_alloc_skb(pkt_size);
if (!skb)
return -ENOMEM;
packet = skb_put(skb, pkt_size); packet = skb_put(skb, pkt_size);
memcpy(packet, bp->mac_addr, 6); memcpy(packet, bp->mac_addr, 6);
memset(packet + 6, 0x0, 8); memset(packet + 6, 0x0, 8);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment