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>
This commit is contained in:
Paul Rolland 2009-12-30 01:07:40 -05:00 committed by Len Brown
parent fda11e61ff
commit c03b26a5a5
1 changed files with 2 additions and 4 deletions

View File

@ -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)