diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-11-17 14:50:55 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 14:20:50 +0100 |
commit | 3eb23426e1749a0483bc4c9b18e51f657569e3ed (patch) | |
tree | 7d8b6cfe52f417cc5e1d887fa7df79750b391e00 /drivers/staging/rtlwifi | |
parent | dcfe023858d94fc608cdec77910105ad7b8d6cce (diff) | |
download | linux-stable-3eb23426e1749a0483bc4c9b18e51f657569e3ed.tar.gz linux-stable-3eb23426e1749a0483bc4c9b18e51f657569e3ed.tar.bz2 linux-stable-3eb23426e1749a0483bc4c9b18e51f657569e3ed.zip |
staging: rtl8822be: fix missing null check on dev_alloc_skb return
dev_alloc_skb can potentially return NULL, so add a null check to
avoid a null pointer dereference on skb
Detected by CoverityScan, CID#1454558 ("Dereference on null return")
Fixes: 7e5b796cde7e ("staging: r8822be: Add the driver code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtlwifi')
-rw-r--r-- | drivers/staging/rtlwifi/rtl8822be/fw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c index f45487122517..483ea85943c3 100644 --- a/drivers/staging/rtlwifi/rtl8822be/fw.c +++ b/drivers/staging/rtlwifi/rtl8822be/fw.c @@ -464,6 +464,8 @@ bool rtl8822b_halmac_cb_write_data_rsvd_page(struct rtl_priv *rtlpriv, u8 *buf, int count; skb = dev_alloc_skb(size); + if (!skb) + return false; memcpy((u8 *)skb_put(skb, size), buf, size); if (!_rtl8822be_send_bcn_or_cmd_packet(rtlpriv->hw, skb, BEACON_QUEUE)) |