[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/39] intel_iommu: Fix mask may be uninitialized in vtd_context_d
From: |
Peter Maydell |
Subject: |
[PULL 03/39] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate |
Date: |
Fri, 12 Mar 2021 13:51:04 +0000 |
From: Eric Auger <eric.auger@redhat.com>
With -Werror=maybe-uninitialized configuration we get
../hw/i386/intel_iommu.c: In function ‘vtd_context_device_invalidate’:
../hw/i386/intel_iommu.c:1888:10: error: ‘mask’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
1888 | mask = ~mask;
| ~~~~~^~~~~~~
Add a g_assert_not_reached() to avoid the error.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20210309102742.30442-2-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/i386/intel_iommu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index b4f5094259e..3206f379f8b 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1884,6 +1884,8 @@ static void vtd_context_device_invalidate(IntelIOMMUState
*s,
case 3:
mask = 7; /* Mask bit 2:0 in the SID field */
break;
+ default:
+ g_assert_not_reached();
}
mask = ~mask;
--
2.20.1
- [PULL 00/39] target-arm queue, Peter Maydell, 2021/03/12
- [PULL 01/39] hw/misc: versal: Add a model of the XRAM controller, Peter Maydell, 2021/03/12
- [PULL 02/39] hw/arm: versal: Add support for the XRAMs, Peter Maydell, 2021/03/12
- [PULL 06/39] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set, Peter Maydell, 2021/03/12
- [PULL 03/39] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate,
Peter Maydell <=
- [PULL 05/39] virtio-iommu: Handle non power of 2 range invalidations, Peter Maydell, 2021/03/12
- [PULL 07/39] hw/arm/smmuv3: Enforce invalidation on a power of two range, Peter Maydell, 2021/03/12
- [PULL 04/39] dma: Introduce dma_aligned_pow2_mask(), Peter Maydell, 2021/03/12
- [PULL 13/39] target/arm: Update find_last_active for PREDDESC, Peter Maydell, 2021/03/12
- [PULL 15/39] target/arm: Update CNTP for PREDDESC, Peter Maydell, 2021/03/12
- [PULL 08/39] hw/arm/smmuv3: Fix SMMU_CMD_CFGI_STE_RANGE handling, Peter Maydell, 2021/03/12
- [PULL 09/39] hw/arm/smmuv3: Uniformize sid traces, Peter Maydell, 2021/03/12
- [PULL 11/39] target/arm: Fix sve_zip_p vs odd vector lengths, Peter Maydell, 2021/03/12
- [PULL 21/39] tests/acceptance: update sunxi kernel from armbian to 5.10.16, Peter Maydell, 2021/03/12
- [PULL 14/39] target/arm: Update BRKA, BRKB, BRKN for PREDDESC, Peter Maydell, 2021/03/12