aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPaul Rolland <rol@as2917.net>2009-12-30 01:19:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-30 12:42:53 -0800
commitb58454ec25e80fdb84e294758aeb22dd6d5ee6f9 (patch)
tree740a1a5f52a81c72077955b56c9a9301cdca1b88 /drivers
parentb73d45dac75fe956ecf6a81c524127f2e44507ef (diff)
wmi: check find_guid() return value to prevent oops
Signed-off-by: rol@as2917.net <Paul Rolland> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/wmi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 9f93d6c0f51..cc9ad740bda 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)