Re: [PATCH] leds: lm3601x: Don't use mutex after it was destroyed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> 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.

I'm sure lots of "use after free" can be fixed by simply removing the
resource freeing... but lets fix this properly.

Best regards,
									Pavel

> +++ b/drivers/leds/flash/leds-lm3601x.c
> @@ -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);
> -- 
> 2.35.1

-- 
People of Russia, stop Putin before his war on Ukraine escalates.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux