Commit a009d29e authored by Wolfram Sang's avatar Wolfram Sang Committed by Anton Vorontsov

ds2782_battery: 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: default avatarWolfram 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: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent db217dec
...@@ -236,8 +236,6 @@ static int ds2782_battery_remove(struct i2c_client *client) ...@@ -236,8 +236,6 @@ static int ds2782_battery_remove(struct i2c_client *client)
idr_remove(&battery_id, info->id); idr_remove(&battery_id, info->id);
mutex_unlock(&battery_lock); mutex_unlock(&battery_lock);
i2c_set_clientdata(client, info);
kfree(info); kfree(info);
return 0; return 0;
} }
...@@ -289,7 +287,6 @@ static int ds2782_battery_probe(struct i2c_client *client, ...@@ -289,7 +287,6 @@ static int ds2782_battery_probe(struct i2c_client *client,
fail_register: fail_register:
kfree(info->battery.name); kfree(info->battery.name);
fail_name: fail_name:
i2c_set_clientdata(client, info);
kfree(info); kfree(info);
fail_info: fail_info:
mutex_lock(&battery_lock); mutex_lock(&battery_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment