staging: rtl8188eu: use safe iterator in expire_timeout_chk
authorMartin Kaiser <martin@kaiser.cx>
Mon, 17 May 2021 20:18:23 +0000 (22:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 15:54:51 +0000 (17:54 +0200)
commit39b19c63a39a2de6516383774a529287f04a243e
treeed57f68871414053da67cba050eee730c522a911
parent565a45a1c301908b169eeae56f21b9f306f6346d
staging: rtl8188eu: use safe iterator in expire_timeout_chk

In the first loop in expire_timeout_chk, we may call rtw_free_stainfo and
remove an entry from auth_list.

In the second loop, we may call list_del_init on our list.

Use list_for_each_entry_safe for both loops.

Fixes: 23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c