Re: [PATCH] platform/x86: asus-wmi: fix resource leaks on probe failure
From: Ilpo Järvinen
Date: Fri Jul 10 2026 - 13:18:31 EST
On Wed, 17 Jun 2026 17:51:04 +0200, Marco Scardovi wrote:
> During driver initialization in asus_wmi_add(), various subsystems are
> registered sequentially. However, the error path labels are out of order
> relative to the registration sequence.
>
> Specifically:
> 1. If asus_wmi_custom_fan_curve_init() fails, the driver jumps to
> fail_custom_fan_curve. Because this label is placed below fail_sysfs,
> it bypasses the cleanup calls for the input device and sysfs groups,
> which were successfully registered before, leaking those resources.
> 2. If asus_screenpad_init() fails, the driver jumps to fail_screenpad.
> Because fail_screenpad is placed below fail_backlight, it bypasses the
> cleanup calls for backlight and rfkill, leaking those resources.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.
The list of commits applied:
[1/1] platform/x86: asus-wmi: fix resource leaks on probe failure
commit: ef3daa2b84a2b8499ce9e2ce1c865dca36d39f95
--
i.