aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-07 21:18:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-09 14:29:01 +0200
commita56d78b5d00db51676cf211e41ec42285fb4a573 (patch)
tree255a01dacec2b3aca3a550c3b4f3913d645587d4 /drivers/staging
parentstaging: rtl8188eu: use safe iterator in xmit_delivery_enabled_frames() (diff)
downloadlinux-dev-a56d78b5d00db51676cf211e41ec42285fb4a573.tar.xz
linux-dev-a56d78b5d00db51676cf211e41ec42285fb4a573.zip
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: 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/YL5i8W7BNla2DlrW@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
index 10a8dcc6ca95..19055a1a92c1 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
@@ -414,6 +414,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
struct xmit_priv *pxmitpriv)
{
struct xmit_frame *pxmitframe = NULL;
+ struct xmit_frame *n;
struct xmit_frame *pfirstframe = NULL;
struct xmit_buf *pxmitbuf;
@@ -422,7 +423,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
struct sta_info *psta = 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_tail; /* last pkt tail */
@@ -507,10 +508,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
spin_lock_bh(&pxmitpriv->lock);
xmitframe_phead = get_list_head(&ptxservq->sta_pending);
- list_for_each(xmitframe_plist, xmitframe_phead) {
- pxmitframe = list_entry(xmitframe_plist, struct xmit_frame,
- list);
-
+ list_for_each_entry_safe(pxmitframe, n, xmitframe_phead, list) {
pxmitframe->agg_num = 0; /* not first frame of aggregation */
pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */