aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-23 02:17:07 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-23 02:17:18 +0100
commit687ade3e4e55ecc26f89190b9dd35a3179fdc485 (patch)
tree21999f134c46048ae1809becb77952c8d056dbc9
parent48e1c56161d40e0fb761f11a7c076553886fb7e4 (diff)
downloadhurd-687ade3e4e55ecc26f89190b9dd35a3179fdc485.tar.gz
hurd-687ade3e4e55ecc26f89190b9dd35a3179fdc485.tar.bz2
hurd-687ade3e4e55ecc26f89190b9dd35a3179fdc485.zip
acpi: Look out for acpi_get_irq_number errors
Otherwise we would take the error as irq number.
-rw-r--r--acpi/acpi-ops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/acpi/acpi-ops.c b/acpi/acpi-ops.c
index 1aaec10c..47f7e3d2 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;
}