mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Initialize acpi buffer structs early in order to avoid freeing
unallocated pointers later in done: section.
This commit is contained in:
parent
8caa8dd355
commit
2b26028dce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123642
@ -125,6 +125,9 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
|
|||||||
|
|
||||||
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
|
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
|
||||||
|
|
||||||
|
buf.Pointer = NULL;
|
||||||
|
crsbuf.Pointer = NULL;
|
||||||
|
prsbuf.Pointer = NULL;
|
||||||
interrupt = 255;
|
interrupt = 255;
|
||||||
|
|
||||||
/* ACPI numbers pins 0-3, not 1-4 like the BIOS */
|
/* ACPI numbers pins 0-3, not 1-4 like the BIOS */
|
||||||
@ -184,7 +187,6 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
|
|||||||
/*
|
/*
|
||||||
* Verify that this is a PCI link device, and that it's present.
|
* Verify that this is a PCI link device, and that it's present.
|
||||||
*/
|
*/
|
||||||
buf.Pointer = NULL;
|
|
||||||
buf.Length = ACPI_ALLOCATE_BUFFER;
|
buf.Length = ACPI_ALLOCATE_BUFFER;
|
||||||
if (ACPI_FAILURE(AcpiGetObjectInfo(lnkdev, &buf))) {
|
if (ACPI_FAILURE(AcpiGetObjectInfo(lnkdev, &buf))) {
|
||||||
device_printf(pcib, "couldn't validate PCI interrupt link device %s\n",
|
device_printf(pcib, "couldn't validate PCI interrupt link device %s\n",
|
||||||
@ -210,14 +212,12 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
|
|||||||
/*
|
/*
|
||||||
* Get the current and possible resources for the interrupt link device.
|
* Get the current and possible resources for the interrupt link device.
|
||||||
*/
|
*/
|
||||||
crsbuf.Pointer = NULL;
|
|
||||||
crsbuf.Length = ACPI_ALLOCATE_BUFFER;
|
crsbuf.Length = ACPI_ALLOCATE_BUFFER;
|
||||||
if (ACPI_FAILURE(status = AcpiGetCurrentResources(lnkdev, &crsbuf))) {
|
if (ACPI_FAILURE(status = AcpiGetCurrentResources(lnkdev, &crsbuf))) {
|
||||||
device_printf(pcib, "couldn't get PCI interrupt link device _CRS data - %s\n",
|
device_printf(pcib, "couldn't get PCI interrupt link device _CRS data - %s\n",
|
||||||
AcpiFormatException(status));
|
AcpiFormatException(status));
|
||||||
goto out; /* this is fatal */
|
goto out; /* this is fatal */
|
||||||
}
|
}
|
||||||
prsbuf.Pointer = NULL;
|
|
||||||
prsbuf.Length = ACPI_ALLOCATE_BUFFER;
|
prsbuf.Length = ACPI_ALLOCATE_BUFFER;
|
||||||
if (ACPI_FAILURE(status = AcpiGetPossibleResources(lnkdev, &prsbuf))) {
|
if (ACPI_FAILURE(status = AcpiGetPossibleResources(lnkdev, &prsbuf))) {
|
||||||
device_printf(pcib, "couldn't get PCI interrupt link device _PRS data - %s\n",
|
device_printf(pcib, "couldn't get PCI interrupt link device _PRS data - %s\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user