leds: aw2013: Unlock mutex before destroying it

BugLink: https://bugs.launchpad.net/bugs/2060097

[ 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: 59ea3c9faf ("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>
(cherry picked from commit bc1afa30180736feda0045565673db0280f89902)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
George Stark
2023-12-14 20:36:05 +03:00
committed by Roxana Nicolescu
parent 78e2cf62f4
commit 4bb2bb04b6
+1
View File
@@ -405,6 +405,7 @@ error_reg:
chip->regulators);
error:
mutex_unlock(&chip->mutex);
mutex_destroy(&chip->mutex);
return ret;
}