[PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wmi_install_notify_handler() retruns ACPI error codes instead of standard
Exxxx error codes and they should not be propagated unchanged to the upper
layers.

Reported-by: Paul Rolland <rol@xxxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>
---

 drivers/platform/x86/dell-wmi.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index ff67a78..79bb1f1 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -265,6 +265,7 @@ static void __init find_hk_type(const struct dmi_header *dm, void *dummy)
 
 static int __init dell_wmi_init(void)
 {
+	acpi_status status;
 	int err;
 
 	if (!wmi_has_guid(DELL_EVENT_GUID)) {
@@ -279,12 +280,12 @@ static int __init dell_wmi_init(void)
 	if (err)
 		return err;
 
-	err = wmi_install_notify_handler(DELL_EVENT_GUID,
-					 dell_wmi_notify, NULL);
-	if (err) {
+	status = wmi_install_notify_handler(DELL_EVENT_GUID,
+					    dell_wmi_notify, NULL);
+	if (!ACPI_SUCCESS(status)) {
 		dell_wmi_input_destroy();
-		pr_err("Unable to register notify handler - %d\n", err);
-		return err;
+		pr_err("Unable to register notify handler - %d\n", status);
+		return -EIO;
 	}
 
 	return 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux