From owner-freebsd-acpi@FreeBSD.ORG Mon Apr 19 03:11:32 2004 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C388116A4CE for ; Mon, 19 Apr 2004 03:11:32 -0700 (PDT) Received: from poup.poupinou.org (poup.poupinou.org [195.101.94.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62FC143D53 for ; Mon, 19 Apr 2004 03:11:32 -0700 (PDT) (envelope-from ducrot@poupinou.org) Received: from ducrot by poup.poupinou.org with local (Exim) id 1BFVjv-0003ej-00; Mon, 19 Apr 2004 12:10:59 +0200 Date: Mon, 19 Apr 2004 12:10:59 +0200 To: Nate Lawson Message-ID: <20040419101059.GB13861@poupinou.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Bruno Ducrot cc: freebsd-acpi@freebsd.org Subject: [PATCH] NULL pointer checking in acpi_pcib.c X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 10:11:32 -0000 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.