staging: r8188eu: fix endless loop in recv_func
authorMartin Kaiser <martin@kaiser.cx>
Sat, 26 Feb 2022 18:14:53 +0000 (19:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Mar 2022 21:33:37 +0000 (22:33 +0100)
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 <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220226181457.1138035-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_recv.c

index 0144c4642911abf76ae3085765d0f58b74d4caae..c9878907de337d11eb9dbe43d25c354159b52231 100644 (file)
@@ -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);
                }