diff options
author | Paul Rolland <rol@as2917.net> | 2009-12-30 09:19:12 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-30 23:42:53 +0300 |
commit | b58454ec25e80fdb84e294758aeb22dd6d5ee6f9 (patch) | |
tree | 740a1a5f52a81c72077955b56c9a9301cdca1b88 /drivers | |
parent | b73d45dac75fe956ecf6a81c524127f2e44507ef (diff) | |
download | linux-b58454ec25e80fdb84e294758aeb22dd6d5ee6f9.tar.xz |
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.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) |