Re: acpi_resource bug?

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 14 Feb 2011 09:24:36 -0500
On Sunday, February 13, 2011 2:46:07 pm Matthew Fleming wrote:
> I'm not very familiar with the acpi code, but we have seen an
> intermittent issue on boot:
> 
> 1) should the length of the bcopy() be changed to either respect
> res->Length or the actual length of the ACPI_RESOURCE_DATA for the
> type?

It should just use res->Length:

Index: acpi_resource.c
===================================================================
--- acpi_resource.c	(revision 218554)
+++ acpi_resource.c	(working copy)
_at__at_ -82,7 +82,7 _at__at_ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *
 	req->found = 1;
 	KASSERT(irq == rman_get_start(req->res),
 	    ("IRQ resources do not match"));
-	bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
+	bcopy(res, req->acpi_res, res->Length);
 	return (AE_CTRL_TERMINATE);
     }
     return (AE_OK);

-- 
John Baldwin
Received on Mon Feb 14 2011 - 13:56:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:11 UTC