Commit a56d78b5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: rtl8188eu: use safe iterator in rtl8188eu_xmitframe_complete()

This loop calls rtw_free_xmitframe(pxmitpriv, pxmitframe) which removes
"pxmitframe" (our list iterator) from the list.  So to prevent a forever
loop we need to use a safe list iterator.

Fixes: 23017c88 ("staging: rtl8188eu: Use list iterators and helpers")
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YL5i8W7BNla2DlrW@mwandaSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 629132b3
...@@ -414,6 +414,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, ...@@ -414,6 +414,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
struct xmit_priv *pxmitpriv) struct xmit_priv *pxmitpriv)
{ {
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
struct xmit_frame *n;
struct xmit_frame *pfirstframe = NULL; struct xmit_frame *pfirstframe = NULL;
struct xmit_buf *pxmitbuf; struct xmit_buf *pxmitbuf;
...@@ -422,7 +423,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, ...@@ -422,7 +423,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct tx_servq *ptxservq = NULL; struct tx_servq *ptxservq = NULL;
struct list_head *xmitframe_plist = NULL, *xmitframe_phead = NULL; struct list_head *xmitframe_phead = NULL;
u32 pbuf; /* next pkt address */ u32 pbuf; /* next pkt address */
u32 pbuf_tail; /* last pkt tail */ u32 pbuf_tail; /* last pkt tail */
...@@ -507,10 +508,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, ...@@ -507,10 +508,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
spin_lock_bh(&pxmitpriv->lock); spin_lock_bh(&pxmitpriv->lock);
xmitframe_phead = get_list_head(&ptxservq->sta_pending); xmitframe_phead = get_list_head(&ptxservq->sta_pending);
list_for_each(xmitframe_plist, xmitframe_phead) { list_for_each_entry_safe(pxmitframe, n, xmitframe_phead, list) {
pxmitframe = list_entry(xmitframe_plist, struct xmit_frame,
list);
pxmitframe->agg_num = 0; /* not first frame of aggregation */ pxmitframe->agg_num = 0; /* not first frame of aggregation */
pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */ pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */
......
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