]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: use kfree_const() to free space conditionally
authorWang ShaoBo <bobo.shaobowang@huawei.com>
Wed, 23 Nov 2022 03:46:16 +0000 (11:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:04 +0000 (11:41 +0100)
commit804283e7fb522649b83d32a92f928385863bfe79
treee1d6bd0edaf9328cfe7a6de3a065b8c1c4b59212
parent72fb53ba086ad72c132c56ea03b8c48edced10b2
regulator: core: use kfree_const() to free space conditionally

[ Upstream commit 40ddf997aade0c73ab9f6a176b79c39044749c4b ]

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: 494d2aba3c15 ("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