aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarshit Mogalapalli <[email protected]>2024-01-22 07:49:52 -0800
committerGuenter Roeck <[email protected]>2024-01-26 10:39:53 -0800
commit97aab852c4b9e1b378de48a55f8c9b8d76c36ccc (patch)
treefa7dec8628643358a636723a67cdea2ce2a7ee95
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
hwmon: gigabyte_waterforce: Fix locking bug in waterforce_get_status()
Goto 'unlock_and_return' for unlocking before returning on the error path. Fixes: d5939a793693 ("hwmon: Add driver for Gigabyte AORUS Waterforce AIO coolers") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Aleksa Savic <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
-rw-r--r--drivers/hwmon/gigabyte_waterforce.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/gigabyte_waterforce.c b/drivers/hwmon/gigabyte_waterforce.c
index 85e523775714..8129d7b3ceaf 100644
--- a/drivers/hwmon/gigabyte_waterforce.c
+++ b/drivers/hwmon/gigabyte_waterforce.c
@@ -146,7 +146,7 @@ static int waterforce_get_status(struct waterforce_data *priv)
/* Send command for getting status */
ret = waterforce_write_expanded(priv, get_status_cmd, GET_STATUS_CMD_LENGTH);
if (ret < 0)
- return ret;
+ goto unlock_and_return;
ret = wait_for_completion_interruptible_timeout(&priv->status_report_received,
msecs_to_jiffies(STATUS_VALIDITY));