[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210516192441.GD2126643@roeck-us.net>
Date: Sun, 16 May 2021 12:24:41 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Martin Kaiser <martin@...ser.cx>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] staging: rtl8188eu: use safe iterator in
rtw_acl_remove_sta
On Sun, May 16, 2021 at 06:06:11PM +0200, Martin Kaiser wrote:
> Use list_for_each_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@...ser.cx>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> compile-tested only
>
> drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
> index a410b42ecb6e..601974df4114 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_ap.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
> @@ -1072,7 +1072,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
>
> int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
> {
> - struct list_head *plist, *phead;
> + struct list_head *plist, *phead, *temp;
> struct rtw_wlan_acl_node *paclnode;
> struct sta_priv *pstapriv = &padapter->stapriv;
> struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
> @@ -1083,7 +1083,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
> spin_lock_bh(&pacl_node_q->lock);
>
> phead = get_list_head(pacl_node_q);
> - list_for_each(plist, phead) {
> + list_for_each_safe(plist, temp, phead) {
> paclnode = list_entry(plist, struct rtw_wlan_acl_node, list);
>
> if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
> --
> 2.20.1
>
Powered by blists - more mailing lists