diff options
author | 2021-06-07 21:17:43 +0300 | |
---|---|---|
committer | 2021-06-09 14:29:01 +0200 | |
commit | e0f489a25a9928da72dbf697ec52e987041c8dd1 (patch) | |
tree | 407da3c1cf8e7ae0b3ee9ee22ad2b4f24dd0e58b /drivers/staging/rtl8188eu/core/rtw_xmit.c | |
parent | staging: rtl8188eu: use safe iterator in tx_beacon_hdl() (diff) | |
download | linux-dev-e0f489a25a9928da72dbf697ec52e987041c8dd1.tar.xz linux-dev-e0f489a25a9928da72dbf697ec52e987041c8dd1.zip |
staging: rtl8188eu: use safe iterator in dequeue_xmitframes_to_sleeping_queue()
On some code paths the xmitframe_enqueue_for_sleeping_sta() function can
call list_del_init(&pxmitframe->list) which would lead to a forever loop
because "pxmitframe" is the list iterator. Use the _safe version of the
iterator to prevent this.
Fixes: 23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YL5ixzKaYKkpHhky@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_xmit.c')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_xmit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index dcc29a74612d..f57e41f817ca 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -1729,17 +1729,15 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struct sta_info *psta, struct __queue *pframequeue) { - struct list_head *plist, *phead; + struct list_head *phead; u8 ac_index; struct tx_servq *ptxservq; struct pkt_attrib *pattrib; - struct xmit_frame *pxmitframe; + struct xmit_frame *pxmitframe, *n; struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; phead = get_list_head(pframequeue); - list_for_each(plist, phead) { - pxmitframe = list_entry(plist, struct xmit_frame, list); - + list_for_each_entry_safe(pxmitframe, n, phead, list) { xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe); pattrib = &pxmitframe->attrib; |