lkml.org 
[lkml]   [2022]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: r8188eu: Check for null pointer after calling skb_clone
Date
As the possible failure of the allocation, the skb_clone may return NULL
pointer.
Therefore, it may cause the dereference of NULL pointer.
Also, same as rtw_os_recv_indicate_pkt() in
`drivers/staging/rtl8723bs/os_dep/recv_linux.c`, it should be better to
add the check.

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
drivers/staging/r8188eu/os_dep/recv_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/os_dep/recv_linux.c b/drivers/staging/r8188eu/os_dep/recv_linux.c
index 917a63e3e94c..cf40f33f3295 100644
--- a/drivers/staging/r8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/r8188eu/os_dep/recv_linux.c
@@ -151,7 +151,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter,

rtw_xmit_entry(skb, pnetdev);

- if (bmcast)
+ if (bmcast && pskb2)
skb = pskb2;
else
goto _recv_indicatepkt_end;
--
2.25.1
\
 
 \ /
  Last update: 2022-01-07 09:02    [W:0.034 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site