Commit af39f935 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

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: 23017c88 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-6-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 22537481
......@@ -1329,17 +1329,15 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment