From: Jan Kiszka <[email protected]>

We won't disable it again because num_smmu_devices will not be
incremented on error.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm64/smmu.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hypervisor/arch/arm64/smmu.c b/hypervisor/arch/arm64/smmu.c
index 89631d16..2e616204 100644
--- a/hypervisor/arch/arm64/smmu.c
+++ b/hypervisor/arch/arm64/smmu.c
@@ -238,7 +238,7 @@ static int arm_smmu_device_reset(struct arm_smmu_device 
*smmu)
        void *gr0_base = ARM_SMMU_GR0(smmu);
        unsigned int idx;
        u32 reg;
-       int ret;
+       int err;
 
        /* Clear global FSR */
        reg = mmio_read32(ARM_SMMU_GR0(smmu) + ARM_SMMU_GR0_sGFSR);
@@ -295,10 +295,11 @@ static int arm_smmu_device_reset(struct arm_smmu_device 
*smmu)
        reg |= sCR0_VMIDPNE | sCR0_PTM | sCR0_USFCFG;
 
        /* Push the button */
-       ret = arm_smmu_tlb_sync_global(smmu);
-       mmio_write32(ARM_SMMU_GR0(smmu) + ARM_SMMU_GR0_sCR0, reg);
+       err = arm_smmu_tlb_sync_global(smmu);
+       if (!err)
+               mmio_write32(ARM_SMMU_GR0(smmu) + ARM_SMMU_GR0_sCR0, reg);
 
-       return ret;
+       return err;
 }
 
 static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/abf70344-7a40-8835-88df-ab970d50c4d5%40siemens.com.

Reply via email to