lkml.org 
[lkml]   [2010]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 02/24] power/ds2782: really clear i2c_clientdata on exit
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.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
---
drivers/power/ds2782_battery.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index da14f37..6971b85 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -236,7 +236,7 @@ static int ds2782_battery_remove(struct i2c_client *client)
idr_remove(&battery_id, info->id);
mutex_unlock(&battery_lock);

- i2c_set_clientdata(client, info);
+ i2c_set_clientdata(client, NULL);

kfree(info);
return 0;
@@ -289,7 +289,7 @@ static int ds2782_battery_probe(struct i2c_client *client,
fail_register:
kfree(info->battery.name);
fail_name:
- i2c_set_clientdata(client, info);
+ i2c_set_clientdata(client, NULL);
kfree(info);
fail_info:
mutex_lock(&battery_lock);
--
1.7.0


\
 
 \ /
  Last update: 2010-03-20 15:17    [W:0.234 / U:7.544 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site