mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Cc: mjg59@srcf.ucam.org, pali@kernel.org,
	Hans de Goede <hansg@kernel.org>,
	 dvhart@infradead.org, platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] platform/x86: dell-laptop: fix missing cleanups in init error path
Date: Wed, 10 Jun 2026 14:41:14 +0300 (EEST)	[thread overview]
Message-ID: <adce8429-e437-48a1-6520-2b95973411eb@linux.intel.com> (raw)
In-Reply-To: <20260609081419.1995169-1-lihaoxiang@isrc.iscas.ac.cn>

On Tue, 9 Jun 2026, Haoxiang Li wrote:

> dell_init() initializes several resources after dell_setup_rfkill(),
> including the optional touchpad LED, keyboard backlight LED, battery
> hook, debugfs directory and dell-laptop notifier.
> 
> If a later LED or backlight registration fails, the error path only
> tears down the battery hook and rfkill resources. This leaves the
> notifier, debugfs directory, keyboard backlight LED and optional
> touchpad LED registered after dell_init() returns an error.
> 
> Add the missing cleanup calls before tearing down rfkill.
> 
> Fixes: 9c656b07997f ("platform/x86: dell-*: Call new led hw_changed API on kbd brightness change")

I've included also these:

Fixes: 037accfa14b2 ("dell-laptop: Add debugfs support")
Fixes: 2d8b90be4f1c ("dell-laptop: support Synaptics/Alps touchpad led")
Fixes: 6cff8d60aa0a ("platform: x86: dell-laptop: Add support for keyboard backlight")

Applied this change to my local the review-ilpo-next branch (it will 
eventually appear in the public one if there are no problems).

--
 i.

> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> Changes in v2:
>  - Fix all missing cleanups in dell_init()'s error path.
>  - Add Fixes tags.
>  - Modify the commit title and message.
> ---
>  drivers/platform/x86/dell/dell-laptop.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell/dell-laptop.c b/drivers/platform/x86/dell/dell-laptop.c
> index 57748c3ea24f..053f40572bf6 100644
> --- a/drivers/platform/x86/dell/dell-laptop.c
> +++ b/drivers/platform/x86/dell/dell-laptop.c
> @@ -2551,7 +2551,12 @@ static int __init dell_init(void)
>  	if (mute_led_registered)
>  		led_classdev_unregister(&mute_led_cdev);
>  fail_led:
> +	dell_laptop_unregister_notifier(&dell_laptop_notifier);
> +	debugfs_remove_recursive(dell_laptop_dir);
>  	dell_battery_exit();
> +	kbd_led_exit();
> +	if (quirks && quirks->touchpad_led)
> +		touchpad_led_exit();
>  	dell_cleanup_rfkill();
>  fail_rfkill:
>  	platform_device_del(platform_device);
> 

      reply	other threads:[~2026-06-10 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  8:14 Haoxiang Li
2026-06-10 11:41 ` Ilpo Järvinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adce8429-e437-48a1-6520-2b95973411eb@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=hansg@kernel.org \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®