提交 7bcaad91 编写于 作者: A Axel Lin 提交者: Mark Brown

ASoC: ak4642: fix a memory leak if failed to initialise AK4642

ak4642 should be kfreed if ak4642_init() return error.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Reviewed-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 fd3c8ac9
......@@ -498,8 +498,10 @@ static int ak4642_i2c_probe(struct i2c_client *i2c,
codec->control_data = i2c;
ret = ak4642_init(ak4642);
if (ret < 0)
if (ret < 0) {
printk(KERN_ERR "failed to initialise AK4642\n");
kfree(ak4642);
}
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册