Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (it87) Check the it87_lock() return value

Return early in it87_resume() if it87_lock() fails instead of ignoring the
return value of that function. This patch suppresses a Clang thread-safety
warning.

Cc: Frank Crawford <frank@crawford.emu.id.au>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org
Fixes: 376e1a937b30 ("hwmon: (it87) Add calls to smbus_enable/smbus_disable as required")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20260223220102.2158611-15-bart.vanassche@linux.dev
[groeck: Declare 'ret' at the beginning of it87_resume()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Bart Van Assche and committed by
Guenter Roeck
07ed4f05 e710b228

+4 -1
+4 -1
drivers/hwmon/it87.c
··· 3590 3590 { 3591 3591 struct platform_device *pdev = to_platform_device(dev); 3592 3592 struct it87_data *data = dev_get_drvdata(dev); 3593 + int err; 3593 3594 3594 3595 it87_resume_sio(pdev); 3595 3596 3596 - it87_lock(data); 3597 + err = it87_lock(data); 3598 + if (err) 3599 + return err; 3597 3600 3598 3601 it87_check_pwm(dev); 3599 3602 it87_check_limit_regs(data);