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 @@ 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); }