Patch "w1: fix loop in w1_fini()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    w1: fix loop in w1_fini()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     w1-fix-loop-in-w1_fini.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7fab2a6bde29ee9a8cf5b2eea008b078d8e3aac2
Author: Dan Carpenter <error27@xxxxxxxxx>
Date:   Wed May 19 17:17:45 2021 +0300

    w1: fix loop in w1_fini()
    
    [ Upstream commit 83f3fcf96fcc7e5405b37d9424c7ef26bfa203f8 ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index cb3650efc29cd..8db9ca241d99c 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -1237,10 +1237,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();



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux