瀏覽代碼

WMI: fix potential NULL pointer dereference

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Dmitry Torokhov 15 年之前
父節點
當前提交
3d2c63eb5e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/platform/x86/wmi.c

+ 2 - 0
drivers/platform/x86/wmi.c

@@ -824,6 +824,8 @@ static acpi_status parse_wdg(acpi_handle handle)
 		return status;
 
 	obj = (union acpi_object *) out.pointer;
+	if (!obj)
+		return AE_ERROR;
 
 	if (obj->type != ACPI_TYPE_BUFFER) {
 		status = AE_ERROR;