diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-10 09:09:51 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-10 09:09:51 +0200 |
commit | 6003ab0bad4cc56f3c4fadf62a0d23a967b9c53b (patch) | |
tree | 2087ca69776116b70a6af0daae9c10bfac1aa347 /sound/soc/codecs/ak4535.c | |
parent | ab7476cf76e560f0efda2a631a70aabe93009025 (diff) | |
parent | adee14b2e1557d0a8559f29681732d05a89dfc35 (diff) |
Merge branch 'linus' into core/debug
Conflicts:
lib/vsprintf.c
Manual merge:
include/linux/kernel.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'sound/soc/codecs/ak4535.c')
-rw-r--r-- | sound/soc/codecs/ak4535.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index b26003c4f3e8..7da9f467b7b8 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c @@ -562,10 +562,9 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) client_template.addr = addr; i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); - if (i2c == NULL) { - kfree(codec); + if (i2c == NULL) return -ENOMEM; - } + i2c_set_clientdata(i2c, codec); codec->control_data = i2c; @@ -583,7 +582,6 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) return ret; err: - kfree(codec); kfree(i2c); return ret; } @@ -660,6 +658,11 @@ static int ak4535_probe(struct platform_device *pdev) #else /* Add other interfaces here */ #endif + + if (ret != 0) { + kfree(codec->private_data); + kfree(codec); + } return ret; } |