mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
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
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue