Re: [PATCH] hwmon: (applesmc) fix key backlight workqueue leak on register failure
From: Guenter Roeck
Date: Fri Aug 28 2026 - 10:49:41 EST
On Fri, Aug 28, 2026 at 05:54:13PM +0700, Cong Nguyen wrote:
> applesmc_create_key_backlight() allocates applesmc_led_wq before calling
> led_classdev_register(). When register fails, the error is returned to
> applesmc_init(), which jumps to out_light_sysfs and skips
> applesmc_release_key_backlight(), leaking the workqueue.
>
> Destroy the workqueue on the register failure path. The bug was introduced
> when the inline init block was refactored into a helper that returns errors
> directly, dropping the old out_light_wq unwind label.
>
> Fixes: 0b0b5dff8967 ("hwmon: (applesmc) Simplify feature sysfs handling")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
Applied.
Thanks,
Guenter