hwmon: (coretemp) Avoid leaving around dangling pointer
authorGuenter Roeck <guenter.roeck@ericsson.com>
Sat, 24 Sep 2011 22:27:04 +0000 (15:27 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Wed, 28 Sep 2011 15:19:21 +0000 (08:19 -0700)
commit20ecb499f64a7e8e7fe03f6098ab25c71b7a6481
tree6cd20d373c279a92acb8917c2945c6132ce66486
parent0eb9782ad9b1bd496ba61cd5ea27ccb8db21e885
hwmon: (coretemp) Avoid leaving around dangling pointer

Storing the struct temp_data pointer allocated from create_core_data()
when returning an error has the potential of leaving around a pointer
to freed memory. Reset it to NULL for error returns.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/coretemp.c