lkml.org 
[lkml]   [2022]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: r8188eu: fix a potential NULL pointer dereference
Date
recvframe_chk_defrag() performs a NULL check on psta, but if that check
fails then it dereferences it, which it shouldn't do as psta is NULL.

Set pdefrag_q to NULL if above check fails and let the code after it handle
that case.

Fixes: 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5")
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index c1005ddaa..db54bceff 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1244,7 +1244,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_fr
pdefrag_q = NULL;
}
} else {
- pdefrag_q = &psta->sta_recvpriv.defrag_q;
+ pdefrag_q = NULL;
}

if ((ismfrag == 0) && (fragnum == 0))
--
2.30.2
\
 
 \ /
  Last update: 2022-04-23 20:49    [W:0.072 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site