summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorPaul Rolland <rol@as2917.net>2009-12-30 01:07:40 -0500
committerLen Brown <len.brown@intel.com>2009-12-30 02:48:55 -0500
commitc03b26a5a5597a59b2e247d005d5901430109a8a (patch)
treea7b2fd29ebcc6febf8b7543404855a64e4a48d0d /drivers/platform
parentfda11e61ff8a4e3a8ebbd434e46560b67cc0ca9d (diff)
downloadop-kernel-dev-c03b26a5a5597a59b2e247d005d5901430109a8a.zip
op-kernel-dev-c03b26a5a5597a59b2e247d005d5901430109a8a.tar.gz
wmi: check find_guid() return value to prevent oops
Signed-off-by: Paul Rolland <rol@as2917.net> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-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 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)
OpenPOWER on IntegriCloud