projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83ddd4c
)
regulator: core: use kfree_const() to free space conditionally
author
Wang ShaoBo
<bobo.shaobowang@huawei.com>
Wed, 23 Nov 2022 03:46:16 +0000
(11:46 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:14 +0000
(13:32 +0100)
[ 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@huawei.com>
Link:
https://lore.kernel.org/r/20221123034616.3609537-1-bobo.shaobowang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index
bc4bba8
..
78b6469
100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-1813,7
+1813,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;
}