git: 1b71cb09074b - stable/15 - acpi_pci_link: Ignore tunables with negative values

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 15:42:45 UTC
The branch stable/15 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=1b71cb09074be51a87a2eb84acb46ee77fceec45

commit 1b71cb09074be51a87a2eb84acb46ee77fceec45
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-11-14 16:02:38 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-11-19 15:42:20 +0000

    acpi_pci_link: Ignore tunables with negative values
    
    IRQ values are unsigned and negative values do not make sense.  The
    invalid IRQ value (255) is already ignored, so ignoring other invalid
    values is consistent with that behavior.
    
    Reported by:    cperciva
    
    (cherry picked from commit 81dab94a5452f996a063bdba2103eda4aa32b3d1)
---
 sys/dev/acpica/acpi_pci_link.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c
index d9807876c443..cb6adee87252 100644
--- a/sys/dev/acpica/acpi_pci_link.c
+++ b/sys/dev/acpica/acpi_pci_link.c
@@ -974,7 +974,8 @@ acpi_pci_link_choose_irq(device_t dev, struct link *link)
 	    sizeof(link_name)))) {
 		snprintf(tunable_buffer, sizeof(tunable_buffer),
 		    "hw.pci.link.%s.%d.irq", link_name, link->l_res_index);
-		if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) {
+		if (getenv_int(tunable_buffer, &i) && i >= 0 &&
+		    PCI_INTERRUPT_VALID(i)) {
 			if (!link_valid_irq(link, i))
 				device_printf(dev,
 				    "Warning, IRQ %d is not listed as valid\n",
@@ -983,7 +984,8 @@ acpi_pci_link_choose_irq(device_t dev, struct link *link)
 		}
 		snprintf(tunable_buffer, sizeof(tunable_buffer),
 		    "hw.pci.link.%s.irq", link_name);
-		if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) {
+		if (getenv_int(tunable_buffer, &i) && i >= 0 &&
+		    PCI_INTERRUPT_VALID(i)) {
 			if (!link_valid_irq(link, i))
 				device_printf(dev,
 				    "Warning, IRQ %d is not listed as valid\n",