diff options
| author | 2021-05-17 22:18:26 +0200 | |
|---|---|---|
| committer | 2021-05-19 17:54:51 +0200 | |
| commit | af39f935c1faefa7ab34bf5bd71ecce3f5b86df3 (patch) | |
| tree | c4be09981d7002c604245f558ce8cead5d85f5bb | |
| parent | staging: rtl8188eu: use safe iterator in rtw_sta_flush (diff) | |
staging: rtl8188eu: use safe iterator in rtw_free_xmitframe_queue
Use list_for_each_entry_safe, we may delete list items while iterating
over the list.
Fixes: 23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_xmit.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index 3763d188b892..dcc29a74612d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -1329,17 +1329,15 @@ exit: void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue) { - struct list_head *plist, *phead; - struct xmit_frame *pxmitframe; + struct list_head *phead; + struct xmit_frame *pxmitframe, *temp; spin_lock_bh(&pframequeue->lock); phead = get_list_head(pframequeue); - list_for_each(plist, phead) { - pxmitframe = list_entry(plist, struct xmit_frame, list); - + list_for_each_entry_safe(pxmitframe, temp, phead, list) rtw_free_xmitframe(pxmitpriv, pxmitframe); - } + spin_unlock_bh(&pframequeue->lock); } |
