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>
This commit is contained in:
Paul Rolland 2009-12-30 01:19:12 -05:00 committed by Linus Torvalds
parent b73d45dac7
commit b58454ec25
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)