summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorAditya Pakki2019-03-20 18:02:49 +0100
committerGreg Kroah-Hartman2019-05-04 09:20:17 +0200
commit5a5f1decd6fc90ac7bbe14704cc2de01b1cb7889 (patch)
tree32efdfc7d36839a30ed943defae309877f92a5e3 /drivers/staging
parentstaging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc (diff)
downloadkernel-qcow2-linux-5a5f1decd6fc90ac7bbe14704cc2de01b1cb7889.tar.gz
kernel-qcow2-linux-5a5f1decd6fc90ac7bbe14704cc2de01b1cb7889.tar.xz
kernel-qcow2-linux-5a5f1decd6fc90ac7bbe14704cc2de01b1cb7889.zip
staging: rtlwifi: rtl8822b: fix to avoid potential NULL pointer dereference
[ Upstream commit d70d70aec9632679dd00dcc1b1e8b2517e2c7da0 ] 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> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Diffstat (limited to 'drivers/staging')
-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 a40396614814..c1ed52df05f0 100644
--- a/drivers/staging/rtlwifi/rtl8822be/fw.c
+++ b/drivers/staging/rtlwifi/rtl8822be/fw.c
@@ -741,6 +741,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);