leds: aw2013: Unlock mutex before destroying it
authorGeorge Stark <gnstark@salutedevices.com>
Thu, 14 Dec 2023 17:36:05 +0000 (20:36 +0300)
committerLee Jones <lee@kernel.org>
Thu, 7 Mar 2024 08:48:10 +0000 (08:48 +0000)
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>
drivers/leds/leds-aw2013.c

index 91f44b23cb113d6b53e877c8fc5ad17ab811d39e..17235a5e576aef330a4f59e0e2d3f84e1af0ff9c 100644 (file)
@@ -405,6 +405,7 @@ error_reg:
                               chip->regulators);
 
 error:
+       mutex_unlock(&chip->mutex);
        mutex_destroy(&chip->mutex);
        return ret;
 }