[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH hurd] acpi: Better error handling on S_acpi_get_pci_irq
From: |
Damien Zammit |
Subject: |
[PATCH hurd] acpi: Better error handling on S_acpi_get_pci_irq |
Date: |
Sat, 28 Dec 2024 06:35:48 +0000 |
This internal function acpi_get_irq_number() returns negative for
error, otherwise returns valid IRQ.
---
acpi/acpi-ops.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/acpi/acpi-ops.c b/acpi/acpi-ops.c
index 1aaec10c..16d96e71 100644
--- a/acpi/acpi-ops.c
+++ b/acpi/acpi-ops.c
@@ -73,6 +73,7 @@ S_acpi_get_pci_irq (struct protid *master,
int *irq)
{
error_t err;
+ int ret;
if (!master)
return EOPNOTSUPP;
@@ -81,6 +82,10 @@ S_acpi_get_pci_irq (struct protid *master,
if (err)
return err;
- *irq = acpi_get_irq_number(bus, dev, func);
- return err;
+ ret = acpi_get_irq_number(bus, dev, func);
+ if (ret < 0)
+ return EIO;
+
+ *irq = ret;
+ return 0;
}
--
2.45.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH hurd] acpi: Better error handling on S_acpi_get_pci_irq,
Damien Zammit <=