Skip to content

Commit

Permalink
leds: lm3601x: Don't use mutex after it was destroyed
Browse files Browse the repository at this point in the history
[ Upstream commit 32f7eed ]

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: e63a744 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Uwe Kleine-König authored and gregkh committed Oct 21, 2022
1 parent 8b7df5e commit 6b357e8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/leds/flash/leds-lm3601x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b357e8

Please sign in to comment.