diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-05-19 16:17:45 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2023-05-08 08:14:50 +0200 |
commit | 83f3fcf96fcc7e5405b37d9424c7ef26bfa203f8 (patch) | |
tree | 3627e83494ca521a061b1687a15941a8cf661460 | |
parent | w1: remove redundant initialization to variable result (diff) | |
download | linux-83f3fcf96fcc7e5405b37d9424c7ef26bfa203f8.tar.xz linux-83f3fcf96fcc7e5405b37d9424c7ef26bfa203f8.zip |
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: 7785925dd8e0 ("[PATCH] w1: cleanups.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-rw-r--r-- | drivers/w1/w1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 074bbdb67f0e..b651e42161e6 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -1253,10 +1253,10 @@ err_out_exit_init: 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(); |