[PATCH] NULL pointer checking in acpi_pcib.c
Bruno Ducrot
ducrot at poupinou.org
Mon Apr 19 03:11:32 PDT 2004
Hi Nate,
I have some little problem (probably a bug in the DSDT, I'm not sure) if
there is not check for crsbuf.Pointer in acpi_pcib_route_interrupt()
after calling acpi_AppendBufferResource().
My latop hang if AC is off-line on boot, or even at runtime.
I'm not sure if that correct, though, but acpi_pci_link_set_irq() will
do this checking anyway, so I guess it's expected that the caller
have to check the return value for crsbuff.Pointer after the call to
acpi_AppendBufferResource(&crsbuf, ...).
Index: sys/dev/acpica/acpi_pcib.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi_pcib.c,v
retrieving revision 1.41
diff -u -p -r1.41 acpi_pcib.c
--- sys/dev/acpica/acpi_pcib.c 22 Mar 2004 20:39:20 -0000 1.41
+++ sys/dev/acpica/acpi_pcib.c 18 Apr 2004 20:47:55 -0000
@@ -369,6 +369,10 @@ acpi_pcib_route_interrupt(device_t pcib,
AcpiFormatException(status));
goto out;
}
+ if (crsbuf.Pointer == NULL) {
+ device_printf(pcib, "crs buffer NULL\n");
+ goto out;
+ }
if (ACPI_FAILURE(status = AcpiSetCurrentResources(lnkdev, &crsbuf))) {
device_printf(pcib, "_SRS failed for interrupt %d via %s - %s\n",
Interrupts[0], acpi_name(lnkdev),
--
Bruno Ducrot
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
More information about the freebsd-acpi
mailing list