linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] mfd: wm831x-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler
@ 2010-08-09  6:51 Axel Lin
  2010-08-10 14:45 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-08-09  6:51 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/wm831x-core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index cb94e7e..1e7aaaf 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -1757,10 +1757,8 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
 	struct wm831x *wm831x;
 
 	wm831x = kzalloc(sizeof(struct wm831x), GFP_KERNEL);
-	if (wm831x == NULL) {
-		kfree(i2c);
+	if (wm831x == NULL)
 		return -ENOMEM;
-	}
 
 	i2c_set_clientdata(i2c, wm831x);
 	wm831x->dev = &i2c->dev;
-- 
1.5.4.3




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

* Re: [PATCH 3/4] mfd: wm831x-core - fix incorrect kfree(i2c) in i2c_driver probe callback handler
  2010-08-09  6:51 [PATCH 3/4] mfd: wm831x-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:51:15PM +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:51 [PATCH 3/4] mfd: wm831x-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;
as well as URLs for NNTP newsgroup(s).