提交 58072cbf 编写于 作者: L Lars-Peter Clausen 提交者: 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: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册