Blob Blame History Raw
From 6969d0a2ba1adc9ba6a49b9805f24080896c255c Mon Sep 17 00:00:00 2001
From: George Stark <gnstark@salutedevices.com>
Date: Thu, 14 Dec 2023 20:36:05 +0300
Subject: [PATCH] leds: aw2013: Unlock mutex before destroying it
Git-commit: 6969d0a2ba1adc9ba6a49b9805f24080896c255c
Patch-mainline: v6.9-rc1
References: git-fixes

In the probe() callback in case of error mutex is destroyed being locked
which is not allowed so unlock the mutex before destroying.

Fixes: 59ea3c9faf32 ("leds: add aw2013 driver")
Signed-off-by: George Stark <gnstark@salutedevices.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20231214173614.2820929-2-gnstark@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/leds/leds-aw2013.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/leds/leds-aw2013.c
+++ b/drivers/leds/leds-aw2013.c
@@ -397,6 +397,7 @@ error_reg:
 	regulator_disable(chip->vcc_regulator);
 
 error:
+	mutex_unlock(&chip->mutex);
 	mutex_destroy(&chip->mutex);
 	return ret;
 }