On Wed, Dec 09, 2020 at 04:34:30AM -0800, tangzhenhao wrote:
>     At line 362 in drivers/iommu/fsl_pamu_domain.c, the ret-val of 
> kmem_cache_zalloc should be checked to avoid null-ptr-deref bug.
> 
> Signed-off-by: tangzhenhao <tz...@mails.tsinghua.edu.cn>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
> index b2110767caf4..9ebd5135f4a8 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -360,6 +360,10 @@ static void attach_device(struct fsl_dma_domain 
> *dma_domain, int liodn, struct d
>       }
>  
>       info = kmem_cache_zalloc(iommu_devinfo_cache, GFP_ATOMIC);
> +     if (!info) {
> +             pr_debug("device_domain_info allocation failed\n");
> +             return;
> +     }

All the comments I made on your other patch [1] apply to this one too.

Will

[1] https://lore.kernel.org/r/20201210091326.GA9633@willie-the-truck
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to