summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2020-06-17 16:21:29 +0100
committerMark Brown <broonie@kernel.org>2020-06-17 17:12:11 +0100
commit95b2c3ec4cb1689db2389c251d39f64490ba641c (patch)
tree4cf411c215ccdf92ece29794cff24ddbb376d320 /drivers/base/regmap
parente680a4098f6404191e0e438a9758715b0bff6d7f (diff)
downloadlinux-95b2c3ec4cb1689db2389c251d39f64490ba641c.tar.bz2
regmap: Fix memory leak from regmap_register_patch
When a register patch is registered the reg_sequence is copied but the memory allocated is never freed. Add a kfree in regmap_exit to clean it up. Fixes: 22f0d90a3482 ("regmap: Support register patch sets") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200617152129.19655-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 183ec789c3fd..06a796821e8b 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1349,6 +1349,7 @@ void regmap_exit(struct regmap *map)
if (map->hwlock)
hwspin_lock_free(map->hwlock);
kfree_const(map->name);
+ kfree(map->patch);
kfree(map);
}
EXPORT_SYMBOL_GPL(regmap_exit);