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: Paul Rolland <rol@as2917.net>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Paul Rolland authored and Len Brown committed Dec 30, 2009
1 parent fda11e6 commit c03b26a
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 c03b26a

Please sign in to comment.