Commit 79d99c30 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

staging/rtl8192u - check for skb alloc failure

It's possible for dev_alloc_skb() to fail. Propagate the error to the caller,
so it can clean up and drop the packet. The sender should end up retransmitting
the packet, hopefully at a time we're prepared to allocate skb's again.
Reported-By: default avatarNicholas Krause <xerofoify@gmail.com>
Signed-Off-By: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f87b447
......@@ -847,6 +847,8 @@ static u8 parse_subframe(struct sk_buff *skb,
#else
/* Allocate new skb for releasing to upper layer */
sub_skb = dev_alloc_skb(nSubframe_Length + 12);
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
memcpy(data_ptr, skb->data, nSubframe_Length);
......
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