From: Oleksandr Tyshchenko Date: Thu, 30 May 2019 12:02:28 +0000 (+0300) Subject: iommu/arm: add missing return X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7d75e66049437d2d88f70aaa1ac0deb0af952b4c;p=people%2Fsstabellini%2Fxen-unstable.git%2F.git iommu/arm: add missing return In case iommu_ops have been already set, we should not update it. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Andrii Anisov Acked-by: Julien Grall --- diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c index 325997b19f..2135233736 100644 --- a/xen/drivers/passthrough/arm/iommu.c +++ b/xen/drivers/passthrough/arm/iommu.c @@ -32,7 +32,10 @@ void __init iommu_set_ops(const struct iommu_ops *ops) BUG_ON(ops == NULL); if ( iommu_ops && iommu_ops != ops ) + { printk("WARNING: Cannot set IOMMU ops, already set to a different value\n"); + return; + } iommu_ops = ops; }