Skip to content

Commit

Permalink
ASoC: wm8974: fix a memory leak if another WM8974 is registered
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 3, 2010
1 parent 6b5d071 commit 4eaac50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/wm8974.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4eaac50

Please sign in to comment.