Skip to content

Commit

Permalink
i2c/tps65010: Add missing intialization of client data
Browse files Browse the repository at this point in the history
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 <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Apr 29, 2008
1 parent 1842cc2 commit 6d072d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/i2c/chips/tps65010.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6d072d7

Please sign in to comment.