Skip to content

Commit 97aab85

Browse files
harshimogalapalligroeck
authored andcommitted
hwmon: gigabyte_waterforce: Fix locking bug in waterforce_get_status()
Goto 'unlock_and_return' for unlocking before returning on the error path. Fixes: d5939a7 ("hwmon: Add driver for Gigabyte AORUS Waterforce AIO coolers") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20240122154952.2851934-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 6613476 commit 97aab85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/gigabyte_waterforce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int waterforce_get_status(struct waterforce_data *priv)
146146
/* Send command for getting status */
147147
ret = waterforce_write_expanded(priv, get_status_cmd, GET_STATUS_CMD_LENGTH);
148148
if (ret < 0)
149-
return ret;
149+
goto unlock_and_return;
150150

151151
ret = wait_for_completion_interruptible_timeout(&priv->status_report_received,
152152
msecs_to_jiffies(STATUS_VALIDITY));

0 commit comments

Comments
 (0)