dect
/
linux-2.6
Archived
13
0
Fork 0

Staging: go7007: 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: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Wolfram Sang 2010-03-20 15:13:01 +01:00 committed by Greg Kroah-Hartman
parent 5ff0dd1826
commit 665752e528
3 changed files with 3 additions and 0 deletions

View File

@ -289,6 +289,7 @@ static int wis_saa7113_probe(struct i2c_client *client,
if (write_regs(client, initial_registers) < 0) {
printk(KERN_ERR
"wis-saa7113: error initializing SAA7113\n");
i2c_set_clientdata(client, NULL);
kfree(dec);
return -ENODEV;
}

View File

@ -422,6 +422,7 @@ static int wis_saa7115_probe(struct i2c_client *client,
if (write_regs(client, initial_registers) < 0) {
printk(KERN_ERR
"wis-saa7115: error initializing SAA7115\n");
i2c_set_clientdata(client, NULL);
kfree(dec);
return -ENODEV;
}

View File

@ -294,6 +294,7 @@ static int wis_tw9903_probe(struct i2c_client *client,
if (write_regs(client, initial_registers) < 0) {
printk(KERN_ERR "wis-tw9903: error initializing TW9903\n");
i2c_set_clientdata(client, NULL);
kfree(dec);
return -ENODEV;
}