Commit 58072cbf authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

regmap: Fix memory leak in regmap_init error path

If regcache initialization fails regmap_init will currently exit without
freeing work_buf.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent c48a9d74
......@@ -229,12 +229,14 @@ struct regmap *regmap_init(struct device *dev,
ret = regcache_init(map);
if (ret < 0)
goto err_map;
goto err_free_workbuf;
regmap_debugfs_init(map);
return map;
err_free_workbuf:
kfree(map->work_buf);
err_map:
kfree(map);
err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment