public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] mfd: wm8994-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler
@ 2010-08-09  6:52 Axel Lin
  2010-08-10 14:45 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-08-09  6:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Mark Brown

The i2c_client received in probe() should not be kfree()'d.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mfd/wm8994-core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index 69533f5..b3b2aaf 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;
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/4] mfd: wm8994-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler
  2010-08-09  6:52 [PATCH 4/4] mfd: wm8994-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler Axel Lin
@ 2010-08-10 14:45 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-08-10 14:45 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Samuel Ortiz

On Mon, Aug 09, 2010 at 02:52:16PM +0800, Axel Lin wrote:
> The i2c_client received in probe() should not be kfree()'d.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-10 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09  6:52 [PATCH 4/4] mfd: wm8994-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler Axel Lin
2010-08-10 14:45 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox