From a12bd462ddabbd60b3f0e423b074c5ff12a21181 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 29 Dec 2011 20:05:00 +0000 Subject: [PATCH] --- yaml --- r: 293172 b: refs/heads/master c: 93e26d4e44e65ef803ea35cfd0fe14fd8af49cb0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/wm8904.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index cbc8ac8fb023..7a11fd85bfa2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 429440c947e72b6f6f317fa4346ddebf9d5e5413 +refs/heads/master: 93e26d4e44e65ef803ea35cfd0fe14fd8af49cb0 diff --git a/trunk/sound/soc/codecs/wm8904.c b/trunk/sound/soc/codecs/wm8904.c index 1ad93737f0fa..98d4f815b4a1 100644 --- a/trunk/sound/soc/codecs/wm8904.c +++ b/trunk/sound/soc/codecs/wm8904.c @@ -2531,7 +2531,8 @@ static __devinit int wm8904_i2c_probe(struct i2c_client *i2c, struct wm8904_priv *wm8904; int ret; - wm8904 = kzalloc(sizeof(struct wm8904_priv), GFP_KERNEL); + wm8904 = devm_kzalloc(&i2c->dev, sizeof(struct wm8904_priv), + GFP_KERNEL); if (wm8904 == NULL) return -ENOMEM; @@ -2541,15 +2542,13 @@ static __devinit int wm8904_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8904, &wm8904_dai, 1); - if (ret < 0) - kfree(wm8904); + return ret; } static __devexit int wm8904_i2c_remove(struct i2c_client *client) { snd_soc_unregister_codec(&client->dev); - kfree(i2c_get_clientdata(client)); return 0; }