Patch "regulator: core: use kfree_const() to free space conditionally" has been added to the 5.15-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

    regulator: core: use kfree_const() to free space conditionally

to the 5.15-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:
     regulator-core-use-kfree_const-to-free-space-conditi.patch
and it can be found in the queue-5.15 subdirectory.

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



commit dbdc4d886ab2868a13fa1de9076d9a0027080029
Author: Wang ShaoBo <bobo.shaobowang@xxxxxxxxxx>
Date:   Wed Nov 23 11:46:16 2022 +0800

    regulator: core: use kfree_const() to free space conditionally
    
    [ Upstream commit dc8d006d15b623c1d80b90b45d6dcb6e890dad09 ]
    
    Use kfree_const() to free supply_name conditionally in create_regulator()
    as supply_name may be allocated from kmalloc() or directly from .rodata
    section.
    
    Fixes: 87fe29b61f95 ("regulator: push allocations in create_regulator() outside of lock")
    Signed-off-by: Wang ShaoBo <bobo.shaobowang@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221123034616.3609537-1-bobo.shaobowang@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7bf85e0cce47..65900895a0b2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1750,7 +1750,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
 
 	regulator = kzalloc(sizeof(*regulator), GFP_KERNEL);
 	if (regulator == NULL) {
-		kfree(supply_name);
+		kfree_const(supply_name);
 		return NULL;
 	}
 



[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