Skip to content

Commit

Permalink
wmi: check find_guid() return value to prevent oops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Rolland authored and Linus Torvalds committed Dec 30, 2009
1 parent b73d45d commit b58454e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b58454e

Please sign in to comment.