Skip to content

Commit 875dd23

Browse files
committed
Merge tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fix from Mark Brown: "A fix for a memory leak when we get an error during regmap init for a bus that uses free_on_exit to clean up device specific data" * tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: fix potential memory leak of regmap_bus
2 parents e2e9e16 + c871c19 commit 875dd23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/base/regmap/regmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,8 @@ struct regmap *__regmap_init(struct device *dev,
11731173
err_map:
11741174
kfree(map);
11751175
err:
1176+
if (bus && bus->free_on_exit)
1177+
kfree(bus);
11761178
return ERR_PTR(ret);
11771179
}
11781180
EXPORT_SYMBOL_GPL(__regmap_init);

0 commit comments

Comments
 (0)