summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorGeorge Stark <gnstark@salutedevices.com>2023-12-14 20:36:05 +0300
committerSasha Levin <sashal@kernel.org>2024-03-26 18:18:42 -0400
commit1910136a96f911b9cf4a1711db700d217963daeb (patch)
tree3bf46d0722731717516d62a9ad6dd42f01555724 /drivers/leds
parent21c2b3c4d05b1fb70a502b3d9df0fb4b2104ccb8 (diff)
downloadlinux-stable-1910136a96f911b9cf4a1711db700d217963daeb.tar.gz
linux-stable-1910136a96f911b9cf4a1711db700d217963daeb.tar.bz2
linux-stable-1910136a96f911b9cf4a1711db700d217963daeb.zip
leds: aw2013: Unlock mutex before destroying it
[ Upstream commit 6969d0a2ba1adc9ba6a49b9805f24080896c255c ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-aw2013.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c
index 91f44b23cb11..17235a5e576a 100644
--- a/drivers/leds/leds-aw2013.c
+++ b/drivers/leds/leds-aw2013.c
@@ -405,6 +405,7 @@ error_reg:
chip->regulators);
error:
+ mutex_unlock(&chip->mutex);
mutex_destroy(&chip->mutex);
return ret;
}