]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
leds: aw2013: Unlock mutex before destroying it
authorGeorge Stark <gnstark@salutedevices.com>
Thu, 14 Dec 2023 17:36:05 +0000 (20:36 +0300)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:21:59 +0000 (18:21 -0400)
[ 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>
drivers/leds/leds-aw2013.c

index 80d937454aeef3fc953dd3dd344f28a5b3a6a95e..f7d9795ce5e1f2d386d4190054bb9af71daf5552 100644 (file)
@@ -397,6 +397,7 @@ error_reg:
        regulator_disable(chip->vcc_regulator);
 
 error:
+       mutex_unlock(&chip->mutex);
        mutex_destroy(&chip->mutex);
        return ret;
 }