From d0a11693967295772d2a7c22b6b37eb20684e709 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 9 Aug 2010 14:52:16 +0800 Subject: mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probe The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin Acked-by: Mark Brown Signed-off-by: Samuel Ortiz diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 69533f5..b3b2aaf8 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -497,10 +497,8 @@ static int wm8994_i2c_probe(struct i2c_client *i2c, struct wm8994 *wm8994; wm8994 = kzalloc(sizeof(struct wm8994), GFP_KERNEL); - if (wm8994 == NULL) { - kfree(i2c); + if (wm8994 == NULL) return -ENOMEM; - } i2c_set_clientdata(i2c, wm8994); wm8994->dev = &i2c->dev; -- cgit v0.10.2