cfg80211: handle failed skb allocation
authorGregory Greenman <gregory.greenman@intel.com>
Tue, 5 Jul 2016 12:23:10 +0000 (15:23 +0300)
committerJohannes Berg <johannes@sipsolutions.net>
Wed, 6 Jul 2016 11:52:18 +0000 (13:52 +0200)
Handle the case when dev_alloc_skb returns NULL.

Cc: stable@vger.kernel.org
Fixes: 2b67f944f88c2 ("cfg80211: reuse existing page fragments in A-MSDU rx")
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
net/wireless/util.c

index 2443ee30ba5b6b0b2844af1cd28d7aa986e44bbf..b7d1592bd5b8939f50d01ee2ce11a95c0df0e93b 100644 (file)
@@ -721,6 +721,8 @@ __ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen,
         * alignment since sizeof(struct ethhdr) is 14.
         */
        frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + cur_len);
+       if (!frame)
+               return NULL;
 
        skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2);
        skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len);