Staging: go7007: fix dangling i2c pointers
authorWolfram Sang <w.sang@pengutronix.de>
Sat, 20 Mar 2010 14:13:01 +0000 (15:13 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:45 +0000 (11:35 -0700)
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>
drivers/staging/go7007/wis-saa7113.c
drivers/staging/go7007/wis-saa7115.c
drivers/staging/go7007/wis-tw9903.c

index 5c12b4d384595013bbd7667c7d5f0b70a035f837..bd925457f8b710ec8b44a86b7a32dddc22d0abfd 100644 (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;
        }
index 73f2283a88034f0b285d3499b05e22b2c57188e5..b2eb804c1954ceedd9fe7986e319c9425551babf 100644 (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;
        }
index 3ac6f785c4ad6c4796de320952980e2606a4c0dd..2afea09091b97e020fff05d4438b1b93156e64a7 100644 (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;
        }