From: Jean Delvare Date: Tue, 29 Apr 2008 21:11:38 +0000 (+0200) Subject: i2c/tps65010: Add missing intialization of client data X-Git-Tag: v2.6.26-rc1~353^2~4 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=6d072d78f87e8fe0fe30d096991b83af07f8bdfe;hp=1842cc2eeb345c4eef069ffd46e95359fb37b4b5;p=safe%2Fjmp%2Flinux-2.6 i2c/tps65010: Add missing intialization of client data tps65010_remove() calls i2c_get_clientdata(client) but the client data is never set during initialization, so it gets a NULL pointer at best. I guess it was never spotted because the tps65010 driver is typically not built modular so this function is discarded. Signed-off-by: Jean Delvare Cc: David Brownell --- diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index b67f69c..feabd12 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c @@ -527,6 +527,7 @@ static int __exit tps65010_remove(struct i2c_client *client) flush_scheduled_work(); debugfs_remove(tps->file); kfree(tps); + i2c_set_clientdata(client, NULL); the_tps = NULL; return 0; } @@ -615,6 +616,7 @@ static int tps65010_probe(struct i2c_client *client) i2c_smbus_read_byte_data(client, TPS_DEFGPIO), i2c_smbus_read_byte_data(client, TPS_MASK3)); + i2c_set_clientdata(client, tps); the_tps = tps; #if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG)