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

From: Sunil V L

Date: Mon Jun 08 2026 - 12:55:50 EST


On Wed, Jun 3, 2026 at 1:52 PM Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx> 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@xxxxxxxxxx>
> Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
> Cc: Sunil V L <sunilvl@xxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxx>