]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (emc2103) Fix use of an uninitilized variable in error case
authorGuenter Roeck <linux@roeck-us.net>
Sat, 2 Jun 2012 17:16:32 +0000 (10:16 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 18 Jun 2012 15:48:00 +0000 (08:48 -0700)
commitd797882f1135aa5ae0dd3346ae28f0070edd1203
tree9df2ed9840eaffdc1de36aae951244457d668cfd
parent7ba5673d42574c1a80d56543ef79dda361e8f411
hwmon: (emc2103) Fix use of an uninitilized variable in error case

Fix:

emc2103.c: In function set_pwm_enable:
emc2103.c:463:12: warning: conf_reg may be used uninitialized in this function

by checking the return value from read_u8_from_i2c(). This fixes a real problem,
as conf_reg is really uninitialized if read_u8_from_i2c returns an error.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/emc2103.c