Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] wmi: check find_guid() return value to prevent oops
       [not found]             ` <20091228175301.4e89aa65@tux.DEF.witbe.net>
@ 2009-12-30  6:19               ` Len Brown
  2009-12-30  6:21               ` [PATCH] dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should follow 0/-E convention Len Brown
  1 sibling, 0 replies; 2+ messages in thread
From: Len Brown @ 2009-12-30  6:19 UTC (permalink / raw)
  To: Paul Rolland
  Cc: Ingo Molnar, Linus Torvalds, Dmitry Torokhov, Matthew Garrett,
	Linux Kernel Mailing List, rol, werner, linux-acpi

From: rol@as2917.net <Paul Rolland>

Signed-off-by: rol@as2917.net <Paul Rolland>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/platform/x86/wmi.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 9f93d6c..cc9ad74 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -492,8 +492,7 @@ wmi_notify_handler handler, void *data)
 	if (!guid || !handler)
 		return AE_BAD_PARAMETER;
 
-	find_guid(guid, &block);
-	if (!block)
+	if (!find_guid(guid, &block))
 		return AE_NOT_EXIST;
 
 	if (block->handler)
@@ -521,8 +520,7 @@ acpi_status wmi_remove_notify_handler(const char *guid)
 	if (!guid)
 		return AE_BAD_PARAMETER;
 
-	find_guid(guid, &block);
-	if (!block)
+	if (!find_guid(guid, &block))
 		return AE_NOT_EXIST;
 
 	if (!block->handler)
-- 
1.6.6.rc4.11.g129a5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should follow 0/-E convention
       [not found]             ` <20091228175301.4e89aa65@tux.DEF.witbe.net>
  2009-12-30  6:19               ` [PATCH] wmi: check find_guid() return value to prevent oops Len Brown
@ 2009-12-30  6:21               ` Len Brown
  1 sibling, 0 replies; 2+ messages in thread
From: Len Brown @ 2009-12-30  6:21 UTC (permalink / raw)
  To: Paul Rolland
  Cc: Ingo Molnar, Linus Torvalds, Dmitry Torokhov, Matthew Garrett,
	Linux Kernel Mailing List, rol, linux-acpi, werner

From: Len Brown <len.brown@intel.com>

wmi_install_notify_handler() returns an acpi_error,
but dell_wmi_init() needs return a -errno style error.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/platform/x86/dell-wmi.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 916ccb2..4c7e702 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -323,6 +323,7 @@ static int __init dell_wmi_input_setup(void)
 static int __init dell_wmi_init(void)
 {
 	int err;
+	acpi_status status;
 
 	if (wmi_has_guid(DELL_EVENT_GUID)) {
 		printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
@@ -336,14 +337,14 @@ static int __init dell_wmi_init(void)
 	if (err)
 		return err;
 
-	err = wmi_install_notify_handler(DELL_EVENT_GUID,
+	status = wmi_install_notify_handler(DELL_EVENT_GUID,
 					 dell_wmi_notify, NULL);
-	if (err) {
+	if (ACPI_FAILURE(status)) {
 		input_unregister_device(dell_wmi_input_dev);
 		printk(KERN_ERR
 			"dell-wmi: Unable to register notify handler - %d\n",
-			err);
-		return err;
+			status);
+		return -ENODEV;
 	}
 
 	return 0;
-- 
1.6.6.rc4.11.g129a5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-30  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.LFD.2.00.0912241350510.11961@localhost.localdomain>
     [not found] ` <20091225102731.GA25513@elte.hu>
     [not found]   ` <alpine.LFD.2.00.0912261504460.4089@localhost.localdomain>
     [not found]     ` <alpine.LFD.2.00.0912262316530.14053@localhost.localdomain>
     [not found]       ` <20091228094444.GG24690@elte.hu>
     [not found]         ` <20091228120125.GA10911@elte.hu>
     [not found]           ` <20091228160212.1f70d825@tux.DEF.witbe.net>
     [not found]             ` <20091228175301.4e89aa65@tux.DEF.witbe.net>
2009-12-30  6:19               ` [PATCH] wmi: check find_guid() return value to prevent oops Len Brown
2009-12-30  6:21               ` [PATCH] dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should follow 0/-E convention Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox