aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Rolland <rol@as2917.net>2009-12-30 01:07:40 -0500
committerLen Brown <len.brown@intel.com>2009-12-30 02:48:55 -0500
commitc03b26a5a5597a59b2e247d005d5901430109a8a (patch)
treea7b2fd29ebcc6febf8b7543404855a64e4a48d0d
parentfda11e61ff8a4e3a8ebbd434e46560b67cc0ca9d (diff)
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>
-rw-r--r--drivers/platform/x86/wmi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 9f93d6c0f510..cc9ad740bda1 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -492,8 +492,7 @@ wmi_notify_handler handler, void *data)
492 if (!guid || !handler) 492 if (!guid || !handler)
493 return AE_BAD_PARAMETER; 493 return AE_BAD_PARAMETER;
494 494
495 find_guid(guid, &block); 495 if (!find_guid(guid, &block))
496 if (!block)
497 return AE_NOT_EXIST; 496 return AE_NOT_EXIST;
498 497
499 if (block->handler) 498 if (block->handler)
@@ -521,8 +520,7 @@ acpi_status wmi_remove_notify_handler(const char *guid)
521 if (!guid) 520 if (!guid)
522 return AE_BAD_PARAMETER; 521 return AE_BAD_PARAMETER;
523 522
524 find_guid(guid, &block); 523 if (!find_guid(guid, &block))
525 if (!block)
526 return AE_NOT_EXIST; 524 return AE_NOT_EXIST;
527 525
528 if (!block->handler) 526 if (!block->handler)