mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
[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>
This commit is contained in:
parent
2f23c523f3
commit
b6cbc3b6fe
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue