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 <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
AxelLin authored and broonie 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.