Skip to content

Commit 95b2c3e

Browse files
charleskeepaxbroonie
authored andcommitted
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: 22f0d90 ("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>
1 parent e680a40 commit 95b2c3e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/base/regmap/regmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,7 @@ void regmap_exit(struct regmap *map)
13491349
if (map->hwlock)
13501350
hwspin_lock_free(map->hwlock);
13511351
kfree_const(map->name);
1352+
kfree(map->patch);
13521353
kfree(map);
13531354
}
13541355
EXPORT_SYMBOL_GPL(regmap_exit);

0 commit comments

Comments
 (0)