staging: rtl8188eu: use safe iterator in rtw_free_all_stainfo
authorMartin Kaiser <martin@kaiser.cx>
Mon, 17 May 2021 20:18:22 +0000 (22:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 15:54:50 +0000 (17:54 +0200)
commit565a45a1c301908b169eeae56f21b9f306f6346d
treef4686854fdc7884a63e2cfe95603ddb932346960
parentd5af74ead205c87c3f4ef479dc937a8e628613a0
staging: rtl8188eu: use safe iterator in rtw_free_all_stainfo

This is another case where we may remove list entries while we iterate over
the list. Use list_for_each_entry_safe to avoid an endless loop.

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-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c