mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Nick <nick@kousu.ca>,
	Saket Dumbre <saket.dumbre@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>
Subject: Re: [PATCH v1 1/3] ACPI: button: Fix ACPI GPE handler leak during removal
Date: Thu, 21 May 2026 08:52:54 -0500	[thread overview]
Message-ID: <7d2f619c-5710-4c39-874b-aab230744014@kernel.org> (raw)
In-Reply-To: <5103522.31r3eYUQgx@rafael.j.wysocki>

On 5/21/26 08:32, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit a7e23ec17fee ("ACPI: button: Install notifier for system events
> as well") changed the ACPI notify handler type for ACPI buttons to
> ACPI_ALL_NOTIFY, but it forgot to update acpi_button_remove() to reflect
> that change.  This leads to leaking the notify handler past driver
> removal, which may cause a kernel crash to occur if ACPI notify on
> the given device is triggered after removing the driver, and causes a
> subsequent probe of the given device with the same driver to fail.
> 
> Address this by updating the acpi_remove_notify_handler() call in
> acpi_button_remove() as appropriate.
> 
> Fixes: a7e23ec17fee ("ACPI: button: Install notifier for system events as well")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Cc: 6.15+ <stable@vger.kernel.org> # 6.15+

Good catch, thanks.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

> ---
>   drivers/acpi/button.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/acpi/button.c
> +++ b/drivers/acpi/button.c
> @@ -689,7 +689,7 @@ static void acpi_button_remove(struct pl
>   						acpi_button_event);
>   		break;
>   	default:
> -		acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
> +		acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
>   					   button->type == ACPI_BUTTON_TYPE_LID ?
>   						acpi_lid_notify :
>   						acpi_button_notify);
> 
> 
> 


  reply	other threads:[~2026-05-21 13:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 13:31 [PATCH v1 0/3] ACPI: button: Fixes related to GPE handling and probe error path Rafael J. Wysocki
2026-05-21 13:32 ` [PATCH v1 1/3] ACPI: button: Fix ACPI GPE handler leak during removal Rafael J. Wysocki
2026-05-21 13:52   ` Mario Limonciello [this message]
2026-05-21 13:38 ` [PATCH v1 2/3] ACPI: button: Enable wakeup GPEs for ACPI buttons at probe time Rafael J. Wysocki
2026-05-22  1:48   ` Nick
2026-05-22 12:25     ` Rafael J. Wysocki
2026-05-22 12:26     ` Rafael J. Wysocki
2026-05-21 13:39 ` [PATCH v1 3/3] ACPI: button: Add missing device class clearing on probe failures Rafael J. Wysocki
2026-05-21 13:53   ` Mario Limonciello

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=7d2f619c-5710-4c39-874b-aab230744014@kernel.org \
    --to=superm1@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@kousu.ca \
    --cc=pawel.chmielewski@intel.com \
    --cc=rafael@kernel.org \
    --cc=saket.dumbre@intel.com \
    /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

Powered by JetHome