]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: syscon: Don't free allocated name for regmap_config
authorMarc Zyngier <maz@kernel.org>
Thu, 3 Sep 2020 16:02:37 +0000 (17:02 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 30 Sep 2020 15:25:16 +0000 (16:25 +0100)
commitfe61e6cb18ffdb2f480646afb5bc0d49e0bd1fc6
tree50181f049af410967b87dd6aad5d917202878474
parent855b8422641ad22b870fd49ce91cd89920966b95
mfd: syscon: Don't free allocated name for regmap_config

The name allocated for the regmap_config structure is freed
pretty early, right after the registration of the MMIO region.

Unfortunately, that doesn't follow the life cycle that debugfs
expects, as it can access the name field long after the free
has occurred.

Move the free on the error path, and keep it forever otherwise.

Fixes: b71253c2e7fc ("mfd: syscon: Use a unique name with regmap_config")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/syscon.c