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:
parent
b73d45dac7
commit
b58454ec25
|
@ -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)
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue