[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.LFD.2.00.0912300116430.15839@localhost.localdomain>
Date: Wed, 30 Dec 2009 01:19:12 -0500 (EST)
From: Len Brown <lenb@...nel.org>
To: Paul Rolland <rol@...917.net>
Cc: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Matthew Garrett <mjg@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
rol@...be.net, werner <w.landgraf@...ru>,
linux-acpi@...r.kernel.org
Subject: [PATCH] wmi: check find_guid() return value to prevent oops
From: rol@...917.net <Paul Rolland>
Signed-off-by: rol@...917.net <Paul Rolland>
Signed-off-by: Len Brown <len.brown@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists