diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-09-04 08:09:09 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-09-04 08:09:09 -0700 |
commit | 0ccd8c39bc664bf5e9fcc26caad50cc17ff866d1 (patch) | |
tree | 29cec0edf3acf18c6978b750a8d6560f445df6df /sound/soc/codecs/ak4535.c | |
parent | 1625324d22409e32e3f8eb86018cad72e1c09d61 (diff) | |
parent | ec0c15afb41fd9ad45b53468b60db50170e22346 (diff) |
Merge branch 'linus' into x86/core
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 b26003c4f3e..7da9f467b7b 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; } |