diff options
author | Paul Rolland <rol@as2917.net> | 2009-12-30 01:07:40 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-30 02:48:55 -0500 |
commit | c03b26a5a5597a59b2e247d005d5901430109a8a (patch) | |
tree | a7b2fd29ebcc6febf8b7543404855a64e4a48d0d /drivers/platform/x86/wmi.c | |
parent | fda11e61ff8a4e3a8ebbd434e46560b67cc0ca9d (diff) |
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/x86/wmi.c')
-rw-r--r-- | 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 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) |