]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
Minor change to print right data when XEN_WMI_DEBUG is enabled.
authorKamala Narasimhan <kamala.narasimhan@citrix.com>
Mon, 23 Feb 2009 20:13:32 +0000 (15:13 -0500)
committerKamala Narasimhan <kamala.narasimhan@citrix.com>
Mon, 23 Feb 2009 20:13:32 +0000 (15:13 -0500)
drivers/xen/acpi-wmi/acpi-wmi.c

index e1f041639134ed9a91b3fa26ff5134e0db8faf03..90d1e3f4e610f8d965c6fb3f714718580d23faa3 100644 (file)
@@ -143,11 +143,18 @@ int xen_wmi_copy_output_buffer(struct acpi_buffer *acpi_buf, xen_wmi_buffer_t *u
 void xen_wmi_print_buffer(struct acpi_buffer *acpi_buf)
 {
     int count;
+    union acpi_object *acpi_obj = acpi_buf->pointer;
+
+    if ( acpi_obj == NULL || acpi_obj->type != ACPI_TYPE_BUFFER )
+    {
+        printk("XEN WMI: Unsupported output buffer data!\n");
+        return ;
+    }
 
-    printk("XEN WMI: Output buffer length is - %d\n", acpi_buf->buffer.length);
+    printk("XEN WMI: Output buffer length is - %d\n", acpi_obj->buffer.length);
     printk("XEN WMI:  Buffer:  ");
-    for (count=0; count < acpi_buf->buffer.length; count++)
-        printk("%d  ", ((byte *)(acpi_buf->buffer.pointer))[count]);
+    for (count=0; count < acpi_obj->buffer.length; count++)
+        printk("%d  ", ((byte *)(acpi_obj->buffer.pointer))[count]);
     printk("\n");
 }