w1: fix loop in w1_fini()

The __w1_remove_master_device() function calls:

	list_del(&dev->w1_master_entry);

So presumably this can cause an endless loop.

Fixes: 7785925dd8 ("[PATCH] w1: cleanups.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
Dan Carpenter 2021-05-19 17:17:45 +03:00 committed by Krzysztof Kozlowski
parent 9033ff4c0f
commit 83f3fcf96f
1 changed files with 2 additions and 2 deletions

View File

@ -1253,10 +1253,10 @@ static int __init w1_init(void)
static void __exit w1_fini(void)
{
struct w1_master *dev;
struct w1_master *dev, *n;
/* Set netlink removal messages and some cleanup */
list_for_each_entry(dev, &w1_masters, w1_master_entry)
list_for_each_entry_safe(dev, n, &w1_masters, w1_master_entry)
__w1_remove_master_device(dev);
w1_fini_netlink();