diff options
author | Paul Rolland | 2009-12-30 01:19:12 -0500 |
---|---|---|
committer | Linus Torvalds | 2009-12-30 12:42:53 -0800 |
commit | b58454ec25e80fdb84e294758aeb22dd6d5ee6f9 (patch) | |
tree | 740a1a5f52a81c72077955b56c9a9301cdca1b88 /drivers | |
parent | b73d45dac75fe956ecf6a81c524127f2e44507ef (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.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) |