diff options
author | Paul Rolland <rol@as2917.net> | 2009-12-30 07:07:40 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-30 08:48:55 +0100 |
commit | c03b26a5a5597a59b2e247d005d5901430109a8a (patch) | |
tree | a7b2fd29ebcc6febf8b7543404855a64e4a48d0d | |
parent | dell-wmi, hp-wmi, msi-wmi: check wmi_get_event_data() return value (diff) | |
download | linux-c03b26a5a5597a59b2e247d005d5901430109a8a.tar.xz linux-c03b26a5a5597a59b2e247d005d5901430109a8a.zip |
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>
-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 9f93d6c0f510..cc9ad740bda1 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) |