rtlwifi: rtl8192c_common: rtl8192de: Check for allocation failures
In https://bugzilla.redhat.com/show_bug.cgi?id=771656, a kernel bug was triggered due to a failed skb allocation that was not checked. This event lead to an audit of all memory allocations in the complete rtlwifi family of drivers. This patch fixes the rest. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
39d02a7d90
commit
76a92be537
@@ -652,6 +652,8 @@ static void _rtl_receive_one(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
return;
|
||||
|
||||
uskb = dev_alloc_skb(skb->len + 128);
|
||||
if (!uskb)
|
||||
return; /* exit if allocation failed */
|
||||
memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status, sizeof(rx_status));
|
||||
pdata = (u8 *)skb_put(uskb, skb->len);
|
||||
memcpy(pdata, skb->data, skb->len);
|
||||
|
Reference in New Issue
Block a user