Re: [PATCH v2 RESEND] iommu/riscv: check pte null pointer before use

From: Paul Walmsley

Date: Thu Jun 25 2026 - 15:10:19 EST


Hi,

On Thu, 7 Aug 2025, XianLiang Huang wrote:

> The riscv_iommu_pte_fetch can return NULL when the provided iova is not
> yet mapped, the caller should check if the returned pointer is NULL or
> not, but riscv_iommu_iova_to_phys missed this, which will then lead to
> a kernel panic.
>
> Check the pointer before using it to avoid the bug. Now, when
> iova_to_phys is called with an unmapped iova, the kernel will not crash
> here.
>
> Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")
> Cc: Tomasz Jeznach <tjeznach@xxxxxxxxxxxx>
> Signed-off-by: XianLiang Huang <huangxianliang@xxxxxxxxxxxxxxxxxxx>

Going through some of the Patchwork backlog. The code that this patch
changes no longer appears to exist. Care to take a look to see if
something like this is still appropriate?

thanks,


- Paul