Commit c03b26a5 authored by Paul Rolland's avatar Paul Rolland Committed by Len Brown

wmi: check find_guid() return value to prevent oops

Signed-off-by: default avatarPaul Rolland <rol@as2917.net>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent fda11e61
...@@ -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