Re: [PATCH v4] iommu/riscv: prevent NULL deref in iova_to_phys
From: XianLiang Huang
Date: Wed Aug 20 2025 - 05:31:20 EST
https://lore.kernel.org/lkml/feb46658-5a3a-4403-b407-500566280eb3@xxxxxx/
I updated the patch in v3, and updated change description accordingly:
In v1
> - if (_io_pte_none(*ptr) || !_io_pte_present(*ptr))
> + if (!ptr || _io_pte_none(*ptr) || !_io_pte_present(*ptr))
In v3
> - if (_io_pte_none(*ptr) || !_io_pte_present(*ptr))
> + if (!ptr)
but put your proposal at the patch Subject...
v1: check pte null pointer before use
v3: prevent NULL deref in iova_to_phys
> …> ---
> > Changes
> > v4:
> > - Change the summary as Markus recommends
> >
> > v3:
sorry for making this messy.
Regards,
Xianliang