public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Aw: [PATCH] power/ds2782: fix clientdata on removal
@ 2010-04-01 11:18 maxmax2010
  0 siblings, 0 replies; 2+ messages in thread
From: maxmax2010 @ 2010-04-01 11:18 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-kernel, w.sang, ryan, hverkuil, cbouatmailru, khali

Testamtwort


-----Ursprüngliche Nachricht-----
Von: maxmax2010@web.de
Gesendet: 01.04.2010 12:27:44
An: linux-i2c@vger.kernel.org
Betreff: [PATCH] power/ds2782: fix clientdata on removal

>Probably due to a copy & paste bug, clientdata was set again to the data
>structure (which is freed immediately afterwards) when it should be
>NULLed. Just remove the calls as the i2c-core does this automatically
>now.
>
>Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>Cc: Ryan Mallon <ryan@bluewatersys.com>
>Cc: Hans Verkuil <hverkuil@xs4all.nl>
>Cc: Anton Vorontsov <cbouatmailru@gmail.com>
>Cc: Jean Delvare <khali@linux-fr.org>
>---
>
>Anton: If it is okay with you, I think this should go via the I2C-tree to
>ensure it comes after the needed modification of the i2c-core.
>
> drivers/power/ds2782_battery.c |    3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
>index da14f37..305d463 100644
>--- a/drivers/power/ds2782_battery.c
>+++ b/drivers/power/ds2782_battery.c
>@@ -236,8 +236,6 @@ static int ds2782_battery_remove(struct i2c_client *client)
> 	idr_remove(&battery_id, info->id);
> 	mutex_unlock(&battery_lock);
> 
>-	i2c_set_clientdata(client, info);
>-
> 	kfree(info);
> 	return 0;
> }
>@@ -289,7 +287,6 @@ static int ds2782_battery_probe(struct i2c_client *client,
> fail_register:
> 	kfree(info->battery.name);
> fail_name:
>-	i2c_set_clientdata(client, info);
> 	kfree(info);
> fail_info:
> 	mutex_lock(&battery_lock);
>-- 
>1.7.0
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

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

* Aw: [PATCH] power/ds2782: fix clientdata on removal
@ 2010-04-01 11:18 maxmax2010
  0 siblings, 0 replies; 2+ messages in thread
From: maxmax2010 @ 2010-04-01 11:18 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-kernel, w.sang, ryan, hverkuil, cbouatmailru, khali

Testamtwort


-----Ursprüngliche Nachricht-----
Von: maxmax2010@web.de
Gesendet: 01.04.2010 12:27:44
An: linux-i2c@vger.kernel.org
Betreff: [PATCH] power/ds2782: fix clientdata on removal

>Probably due to a copy & paste bug, clientdata was set again to the data
>structure (which is freed immediately afterwards) when it should be
>NULLed. Just remove the calls as the i2c-core does this automatically
>now.
>
>Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>Cc: Ryan Mallon <ryan@bluewatersys.com>
>Cc: Hans Verkuil <hverkuil@xs4all.nl>
>Cc: Anton Vorontsov <cbouatmailru@gmail.com>
>Cc: Jean Delvare <khali@linux-fr.org>
>---
>
>Anton: If it is okay with you, I think this should go via the I2C-tree to
>ensure it comes after the needed modification of the i2c-core.
>
> drivers/power/ds2782_battery.c |    3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
>index da14f37..305d463 100644
>--- a/drivers/power/ds2782_battery.c
>+++ b/drivers/power/ds2782_battery.c
>@@ -236,8 +236,6 @@ static int ds2782_battery_remove(struct i2c_client *client)
> 	idr_remove(&battery_id, info->id);
> 	mutex_unlock(&battery_lock);
> 
>-	i2c_set_clientdata(client, info);
>-
> 	kfree(info);
> 	return 0;
> }
>@@ -289,7 +287,6 @@ static int ds2782_battery_probe(struct i2c_client *client,
> fail_register:
> 	kfree(info->battery.name);
> fail_name:
>-	i2c_set_clientdata(client, info);
> 	kfree(info);
> fail_info:
> 	mutex_lock(&battery_lock);
>-- 
>1.7.0
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2010-04-01 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 11:18 Aw: [PATCH] power/ds2782: fix clientdata on removal maxmax2010
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 11:18 maxmax2010

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