diff mbox series

[v4,01/10] leds: aw2013: unlock mutex before destroying it

Message ID 20231214173614.2820929-2-gnstark@salutedevices.com
State New
Headers show
Series devm_led_classdev_register() usage problem | expand

Commit Message

George Stark Dec. 14, 2023, 5:36 p.m. UTC
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>
---
 drivers/leds/leds-aw2013.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lee Jones Feb. 23, 2024, 3:07 p.m. UTC | #1
On Thu, 14 Dec 2023 20:36:05 +0300, George Stark wrote:
> In the probe() callback in case of error mutex is destroyed being locked
> which is not allowed so unlock the mutex before destroying.
> 
> 

Applied, thanks!

[01/10] leds: aw2013: unlock mutex before destroying it
        commit: eb0f0a751c8e26b212f78fe7325fa2506c5cbb4b

--
Lee Jones [李琼斯]
diff mbox series

Patch

diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c
index 59765640b70f..c2bc0782c0cd 100644
--- a/drivers/leds/leds-aw2013.c
+++ b/drivers/leds/leds-aw2013.c
@@ -397,6 +397,7 @@  static int aw2013_probe(struct i2c_client *client)
 	regulator_disable(chip->vcc_regulator);
 
 error:
+	mutex_unlock(&chip->mutex);
 	mutex_destroy(&chip->mutex);
 	return ret;
 }