From: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Paul Bolle <pebolle@tiscali.nl>
Cc: Jerry Chuang <jerry-chuang@realtek.com>,
devel@driverdev.osuosl.org, nick <xerofoify@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] staging/rtl8192u - check for skb alloc failure
Date: Mon, 08 Sep 2014 18:09:48 -0400 [thread overview]
Message-ID: <75005.1410214188@turing-police.cc.vt.edu> (raw)
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);
reply other threads:[~2014-09-08 22:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75005.1410214188@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jerry-chuang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pebolle@tiscali.nl \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®