Skip to content

Commit

Permalink
[BNX2]: check return of dev_alloc_skb in bnx2_test_loopback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John W. Linville authored and David S. Miller committed Nov 10, 2005
1 parent 2f23c52 commit b6cbc3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b6cbc3b

Please sign in to comment.