[PATCH v2 3/3] ACPI: button: Add missing device class clearing on probe failures

Rafael J. Wysocki posted 1 patch 2 days, 3 hours ago
drivers/acpi/button.c |    1 +
1 file changed, 1 insertion(+)
[PATCH v2 3/3] ACPI: button: Add missing device class clearing on probe failures
Posted by Rafael J. Wysocki 2 days, 3 hours ago
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Commit e18947038bf4 ("ACPI: driver: Do not set acpi_device_class()
unnecessarily") modified acpi_button_remove() to clear the device class
field in struct acpi_device on driver removal, but it should also have
updated the rollback path in acpi_button_probe(), which it didn't do,
so do it now.

Fixes: e18947038bf4 ("ACPI: driver: Do not set acpi_device_class() unnecessarily")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
---

v1 -> v2:
   * Add R-by from Mario
   * No other changes

---
 drivers/acpi/button.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -687,6 +687,7 @@ err_remove_fs:
 	acpi_button_remove_fs(button);
 err_free_button:
 	kfree(button);
+	memset(acpi_device_class(device), 0, sizeof(acpi_device_class));
 	return error;
 }