summaryrefslogtreecommitdiff
path: root/drivers/acpi/button.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-10-30 19:05:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-10-30 19:05:46 -0700
commita5355e98accb20d8ea06008fd8fb5755cc52e8c0 (patch)
tree9d9bddb0c5b5dba9be637802bf8d921fa00fdb8e /drivers/acpi/button.c
parenta5dbbb39e11d50a8c426b8d88f5b12031fee49f3 (diff)
parent8907226bed1ebd10d069f6f70ff0aaa8840f3267 (diff)
Merge tag 'acpi-6.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix three ACPI driver issues and add version checks to two ACPI table parsers: - Call input_free_device() on failing input device registration as necessary (and mentioned in the input subsystem documentation) in the ACPI button driver (Kaushlendra Kumar) - Fix use-after-free in acpi_video_switch_brightness() by canceling a delayed work during tear-down (Yuhao Jiang) - Use platform device for devres-related actions in the ACPI fan driver to allow device-managed resources to be cleaned up properly (Armin Wolf) - Add version checks to the MRRM and SPCR table parsers (Tony Luck and Punit Agrawal)" * tag 'acpi-6.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: SPCR: Check for table version when using precise baudrate ACPI: MRRM: Check revision of MRRM table ACPI: fan: Use platform device for devres-related actions ACPI: fan: Use ACPI handle when retrieving _FST ACPI: video: Fix use-after-free in acpi_video_switch_brightness() ACPI: button: Call input_free_device() on failing input device registration
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r--drivers/acpi/button.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 0a7026040188..3c6dd9b4ba0a 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -619,8 +619,10 @@ static int acpi_button_add(struct acpi_device *device)
input_set_drvdata(input, device);
error = input_register_device(input);
- if (error)
+ if (error) {
+ input_free_device(input);
goto err_remove_fs;
+ }
switch (device->device_type) {
case ACPI_BUS_TYPE_POWER_BUTTON: