dev-arm: Initialize cd_addr in src/dev/arm/smmu_v3_transl.cc
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Thu, 30 Jul 2020 22:51:58 +0000 (15:51 -0700)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Fri, 31 Jul 2020 18:41:27 +0000 (18:41 +0000)
In src/dev/arm/smmu_v3_transl.cc#L1401, cd_addr might not be
initialized when all if statements fail.

Change-Id: Idf53c07a9b5d52eea488e631f7334d4b566e645a
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32015
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/smmu_v3_transl.cc

index 209b04f06f48c5af4f9358042e835cf56d3ce8a8..c7b20f9246788b14482db1862125116636a1a176 100644 (file)
@@ -1398,7 +1398,7 @@ SMMUTranslationProcess::doReadCD(Yield &yield,
                                  const StreamTableEntry &ste,
                                  uint32_t sid, uint32_t ssid)
 {
-    Addr cd_addr;
+    Addr cd_addr = 0;
 
     if (ste.dw0.s1cdmax == 0) {
         cd_addr = ste.dw0.s1ctxptr << ST_CD_ADDR_SHIFT;