Skip to content

Commit

Permalink
ds2782_battery: Fix clientdata on removal
Browse files Browse the repository at this point in the history
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: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Wolfram Sang authored and Anton Vorontsov committed Apr 6, 2010
1 parent db217de commit a009d29
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/power/ds2782_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a009d29

Please sign in to comment.