All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/rtl8192u - check for skb alloc failure
@ 2014-09-08 22:09 Valdis Kletnieks
  0 siblings, 0 replies; only message in thread
From: Valdis Kletnieks @ 2014-09-08 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Paul Bolle; +Cc: Jerry Chuang, devel, nick, linux-kernel

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 <xerofoify@gmail.com>
Signed-Off-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>

--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c	2014-09-05 15:51:00.005660044 -0400
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c	2014-09-08 17:42:16.773748142 -0400
@@ -847,6 +847,8 @@ static u8 parse_subframe(struct sk_buff
 #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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-08 22:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 22:09 [PATCH] staging/rtl8192u - check for skb alloc failure Valdis Kletnieks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.