forked from luck/tmp_suning_uos_patched
ASoC: wm8974: fix a memory leak if another WM8974 is registered
wm8974 is allocated in wm8974_i2c_probe() but is not freed if wm8974_register() return -EINVAL (if another WM8974 is registered). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
6b5d071e8b
commit
4eaac50552
|
@ -670,7 +670,8 @@ static __devinit int wm8974_register(struct wm8974_priv *wm8974)
|
|||
|
||||
if (wm8974_codec) {
|
||||
dev_err(codec->dev, "Another WM8974 is registered\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
mutex_init(&codec->mutex);
|
||||
|
|
Loading…
Reference in New Issue
Block a user