From 79d99c305fd4edb9ee11ff57f43dc961ad684ab6 Mon Sep 17 00:00:00 2001 From: Valdis Kletnieks Date: Mon, 8 Sep 2014 18:09:48 -0400 Subject: [PATCH] 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: Nicholas Krause Signed-Off-By: Valdis Kletnieks Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 40da37fdbcdc..73de9e9669f6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -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); -- 2.20.1