]> git.baikalelectronics.ru Git - kernel.git/commitdiff
leds: lm3601x: Don't use mutex after it was destroyed
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 15 Aug 2022 08:02:27 +0000 (10:02 +0200)
committerWolfram Sang <wsa@kernel.org>
Tue, 16 Aug 2022 10:33:55 +0000 (12:33 +0200)
The mutex might still be in use until the devm cleanup callback
devm_led_classdev_flash_release() is called. This only happens some time
after lm3601x_remove() completed.

Fixes: 6393b0fc6360 ("leds: lm3601x: Convert class registration to device managed")
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/leds/flash/leds-lm3601x.c

index d0e1d4814042e52c5896df61c923e197181c63e3..3d127274820173667a9648de4a2af2ca821cbf3e 100644 (file)
@@ -444,8 +444,6 @@ static int lm3601x_remove(struct i2c_client *client)
 {
        struct lm3601x_led *led = i2c_get_clientdata(client);
 
-       mutex_destroy(&led->lock);
-
        return regmap_update_bits(led->regmap, LM3601X_ENABLE_REG,
                           LM3601X_ENABLE_MASK,
                           LM3601X_MODE_STANDBY);