Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Apr 2004 12:10:59 +0200
From:      Bruno Ducrot <ducrot@poupinou.org>
To:        Nate Lawson <nate@root.org>
Cc:        freebsd-acpi@freebsd.org
Subject:   [PATCH] NULL pointer checking in acpi_pcib.c
Message-ID:  <20040419101059.GB13861@poupinou.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040419101059.GB13861>