[PATCH] media: rkvdec: Fix incorrect NULL check for iommu_paging_domain_alloc
Heiko Stübner
heiko at sntech.de
Tue Aug 5 01:40:02 PDT 2025
Am Dienstag, 5. August 2025, 08:18:33 Mitteleuropäische Sommerzeit schrieb Miaoqian Lin:
> iommu_paging_domain_alloc returns error pointers on failure.
> Replace the NULL check with IS_ERR to correctly handle error cases
> and avoid invalid pointer dereference.
>
> Fixes: ff8c5622f9f7 ("media: rkvdec: Restore iommu addresses on errors")
> Signed-off-by: Miaoqian Lin <linmq006 at gmail.com>
Going from the (static inline) function definition [0] to the
iommu_paging_domain_alloc_flags() function [1] it uses, the doc states
"Return [...] or an ERR pointer for failure."
So this is the correct fix,
Reviewed-by: Heiko Stuebner <heiko at sntech.de>
[0] https://elixir.bootlin.com/linux/v6.16/source/include/linux/iommu.h#L858
[1] https://elixir.bootlin.com/linux/v6.16/source/drivers/iommu/iommu.c#L2046
More information about the linux-arm-kernel
mailing list