[PATCH v2 2/6] ACPI: RISC-V: Check acpi_get_handle() status in riscv_acpi_add_prt_dep()

Sunil V L sunilvl at oss.qualcomm.com
Mon Jun 8 09:31:16 PDT 2026


On Wed, Jun 3, 2026 at 1:52 PM Lorenzo Pieralisi <lpieralisi at kernel.org> wrote:
>
> In riscv_acpi_add_prt_dep(), the acpi_get_handle() call can fail which
> would leave link_handle uninitialized.
>
> Fix it by checking the acpi_get_handle() return status and skip the entry
> if it fails.
>
> Signed-off-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
> Cc: "Rafael J. Wysocki" <rafael at kernel.org>
> Cc: Sunil V L <sunilvl at ventanamicro.com>
> ---
>  drivers/acpi/riscv/irq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
> index cd83c3035cf6..75170151c614 100644
> --- a/drivers/acpi/riscv/irq.c
> +++ b/drivers/acpi/riscv/irq.c
> @@ -339,7 +339,9 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
>         entry = buffer.pointer;
>         while (entry && (entry->length > 0)) {
>                 if (entry->source[0]) {
> -                       acpi_get_handle(handle, entry->source, &link_handle);
> +                       status = acpi_get_handle(handle, entry->source, &link_handle);
> +                       if (ACPI_FAILURE(status))
> +                               continue;
>                         dep_devices.count = 1;
>
Reviewed-by: Sunil V L <sunilvl at oss.qualcomm.com>



More information about the linux-arm-kernel mailing list