]> git.karo-electronics.de Git - karo-tx-linux.git/commit
macintosh: Don't assume i2c device probing always succeeds
authorJean Delvare <khali@linux-fr.org>
Sun, 4 Oct 2009 20:53:46 +0000 (22:53 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Oct 2009 22:11:58 +0000 (15:11 -0700)
commitcdb2cc1110db0fbe2a2dddf86933248a904e3532
tree4bb7313a995e15c888bd1e64b9ee497f21464f1d
parent95852f92e969211e2c30d205e75d032cbc7e5cfc
macintosh: Don't assume i2c device probing always succeeds

commit 6f6b35e133fe4313277b30fc1a7ea313875ea6c9 upstream.

If i2c device probing fails, then there is no driver to dereference
after calling i2c_new_device(). Stop assuming that probing will always
succeed, to avoid NULL pointer dereferences. We have an easier access
to the driver anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Tim Shepard <shep@alum.mit.edu>
Cc: Colin Leroy <colin@colino.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/macintosh/therm_adt746x.c
drivers/macintosh/therm_pm72.c
drivers/macintosh/windfarm_lm75_sensor.c
drivers/macintosh/windfarm_max6690_sensor.c
drivers/macintosh/windfarm_smu_sat.c