Commit b58454ec authored by Paul Rolland's avatar Paul Rolland Committed by Linus Torvalds

wmi: check find_guid() return value to prevent oops

Signed-off-by: rol@as2917.net <Paul Rolland>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b73d45da
...@@ -492,8 +492,7 @@ wmi_notify_handler handler, void *data) ...@@ -492,8 +492,7 @@ wmi_notify_handler handler, void *data)
if (!guid || !handler) if (!guid || !handler)
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
find_guid(guid, &block); if (!find_guid(guid, &block))
if (!block)
return AE_NOT_EXIST; return AE_NOT_EXIST;
if (block->handler) if (block->handler)
...@@ -521,8 +520,7 @@ acpi_status wmi_remove_notify_handler(const char *guid) ...@@ -521,8 +520,7 @@ acpi_status wmi_remove_notify_handler(const char *guid)
if (!guid) if (!guid)
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
find_guid(guid, &block); if (!find_guid(guid, &block))
if (!block)
return AE_NOT_EXIST; return AE_NOT_EXIST;
if (!block->handler) if (!block->handler)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment