Patch "gpio: sim: initialize a managed pointer when declaring it" has been added to the 6.6-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

    gpio: sim: initialize a managed pointer when declaring it

to the 6.6-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:
     gpio-sim-initialize-a-managed-pointer-when-declaring.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 66e70f66de0669c2ea8fc9064882480962aab553
Author: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
Date:   Sun Sep 17 10:58:37 2023 +0200

    gpio: sim: initialize a managed pointer when declaring it
    
    [ Upstream commit 9f93f18305f5777820491e6ab9b34422c160371b ]
    
    Variables managed with __free() should typically be initialized where
    they are declared so that the __free() callback is paired with its
    counterpart resource allocator. Fix the second instance of using
    __free() in gpio-sim to follow this pattern.
    
    Fixes: 3faf89f27aab ("gpio: sim: simplify code with cleanup helpers")
    Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index 44bf1709a6488..a8e5ac95cf170 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -1438,10 +1438,10 @@ static const struct config_item_type gpio_sim_device_config_group_type = {
 static struct config_group *
 gpio_sim_config_make_device_group(struct config_group *group, const char *name)
 {
-	struct gpio_sim_device *dev __free(kfree) = NULL;
 	int id;
 
-	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	struct gpio_sim_device *dev __free(kfree) = kzalloc(sizeof(*dev),
+							    GFP_KERNEL);
 	if (!dev)
 		return ERR_PTR(-ENOMEM);
 



[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