Re: [PATCH 14/62] hwmon: (it87) Check the it87_lock() return value

From: Guenter Roeck

Date: Tue Feb 24 2026 - 10:36:52 EST


On Mon, Feb 23, 2026 at 02:00:14PM -0800, Bart Van Assche wrote:
> From: Bart Van Assche <bvanassche@xxxxxxx>
>
> 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@xxxxxxxxxxxxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Jean Delvare <jdelvare@xxxxxxxx>
> Cc: linux-hwmon@xxxxxxxxxxxxxxx
> Fixes: 376e1a937b30 ("hwmon: (it87) Add calls to smbus_enable/smbus_disable as required")
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
> drivers/hwmon/it87.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index e233aafa8856..8e3935089fca 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -3593,7 +3593,9 @@ static int it87_resume(struct device *dev)
>
> it87_resume_sio(pdev);
>
> - it87_lock(data);
> + int err = it87_lock(data);
> + if (err)
> + return err;

checkpatch: missing empty line after declarations.

Oh, never mind, I'll fix that up and declare ret at the beginning of the
function, to match the rest of the driver.

Applied.

Guenter