summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2019-03-20 12:02:49 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-21 08:32:57 +0100
commitd70d70aec9632679dd00dcc1b1e8b2517e2c7da0 (patch)
treef9aabb81d3396895d5558ce6530742f5cb2203a2 /drivers
parent7671ce0d92933762f469266daf43bd34d422d58c (diff)
downloadlinux-stable-d70d70aec9632679dd00dcc1b1e8b2517e2c7da0.tar.gz
linux-stable-d70d70aec9632679dd00dcc1b1e8b2517e2c7da0.tar.bz2
linux-stable-d70d70aec9632679dd00dcc1b1e8b2517e2c7da0.zip
staging: rtlwifi: rtl8822b: fix to avoid potential NULL pointer dereference
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtlwifi/rtl8822be/fw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c
index f061dd1382aa..cf6b7a80b753 100644
--- a/drivers/staging/rtlwifi/rtl8822be/fw.c
+++ b/drivers/staging/rtlwifi/rtl8822be/fw.c
@@ -743,6 +743,8 @@ void rtl8822be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
u1_rsvd_page_loc, 3);
skb = dev_alloc_skb(totalpacketlen);
+ if (!skb)
+ return;
memcpy((u8 *)skb_put(skb, totalpacketlen), &reserved_page_packet,
totalpacketlen);