From: Martin Kaiser Date: Sat, 26 Feb 2022 18:14:53 +0000 (+0100) Subject: staging: r8188eu: fix endless loop in recv_func X-Git-Tag: howlett/maple/20220722_2~883^2~84 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1327fcf175fa63d3b7a058b8148ed7714acdc035;p=users%2Fjedix%2Flinux-maple.git staging: r8188eu: fix endless loop in recv_func Fix an endless loop in recv_func. If pending_frame is not NULL, we're stuck in the while loop forever. We have to call rtw_alloc_recvframe each time we loop. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reported-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index 0144c4642911a..c9878907de337 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -1800,8 +1800,7 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe) struct recv_frame *pending_frame; int cnt = 0; - pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue); - while (pending_frame) { + while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) { cnt++; recv_func_posthandle(padapter, pending_frame); }