Commit 5ff0dd18 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

Staging: dream: fix dangling i2c pointers

Fix I2C-drivers which missed setting clientdata to NULL before freeing the
structure it points to. Also fix drivers which do this _after_ the structure
was freed already.
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 593a9616
...@@ -535,6 +535,7 @@ static int __devinit synaptics_ts_probe( ...@@ -535,6 +535,7 @@ static int __devinit synaptics_ts_probe(
err_input_dev_alloc_failed: err_input_dev_alloc_failed:
err_detect_failed: err_detect_failed:
err_power_failed: err_power_failed:
i2c_set_clientdata(client, NULL);
kfree(ts); kfree(ts);
err_alloc_data_failed: err_alloc_data_failed:
err_check_functionality_failed: err_check_functionality_failed:
...@@ -552,6 +553,7 @@ static int synaptics_ts_remove(struct i2c_client *client) ...@@ -552,6 +553,7 @@ static int synaptics_ts_remove(struct i2c_client *client)
else else
hrtimer_cancel(&ts->timer); hrtimer_cancel(&ts->timer);
input_unregister_device(ts->input_dev); input_unregister_device(ts->input_dev);
i2c_set_clientdata(client, NULL);
kfree(ts); kfree(ts);
return 0; return 0;
} }
......
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