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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e680a40 commit 95b2c3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)