On 17/10/2022 17:51, Henry Wang wrote:
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index f17500ddf3..0b4e24218e 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1784,6 +1800,8 @@ int p2m_init(struct domain *d)
>          !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
>  
>      rc = p2m_alloc_table(d);
> +    if ( rc != 0 )
> +        return rc;

This error path now leaks the VMID.

And to preempt the obvious change, if you simply move this lower, you'll
introduce a path where p2m_teardown() falls over a NULL pointer.

~Andrew

Reply via email to