Skip to contentSkip to conversation

target-mips queue for 2.6

GIT PULL Applied Leon Alrae 2 participants 3 messages Apr 8, 2016

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

Hi,

Just a single bug-fix for MIPS ITU.

Thanks,
Leon

Cc Peter Maydell <[email protected]>
Cc Aurelien Jarno <[email protected]>

The following changes since commit ead5268f2166101f7dde70598c9f538a90afd8ee:

Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-04-07-tag' into staging (2016-04-07 18:06:14 +0100)

are available in the git repository at:

git://github.com/lalrae/qemu.git tags/mips-20160408

for you to fetch changes up to f2eb665a11a34ac9f6459f8a18c3d9d8be9ca359:

hw/mips_itu: fix off-by-one reported by Coverity (2016-04-08 09:19:26 +0100)

----------------------------------------------------------------
MIPS patches 2016-04-08

Changes:
* fix off-by-one error in ITU

----------------------------------------------------------------
Leon Alrae (1):
hw/mips_itu: fix off-by-one reported by Coverity

 hw/misc/mips_itu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
author
#1 lore raw

[Qemu-devel] [PULL 1/1] hw/mips_itu: fix off-by-one reported by Coverity

Fix off-by-one error in ITC Tag read.

Remove the switch as we just want to check if index is in valid range rather than test against list of values.

---
 hw/misc/mips_itu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
hw/misc/mips_itu.c +3 -8
index 8461d23..da54550 100644
@@ -66,18 +66,13 @@ static uint64_t itc_tag_read(void *opaque, hwaddr addr, unsigned size)
 {
     MIPSITUState *tag = (MIPSITUState *)opaque;
     uint64_t index = addr >> 3;
-    uint64_t ret = 0;
 
-    switch (index) {
-    case 0 ... ITC_ADDRESSMAP_NUM:
-        ret = tag->ITCAddressMap[index];
-        break;
-    default:
+    if (index >= ITC_ADDRESSMAP_NUM) {
         qemu_log_mask(LOG_GUEST_ERROR, "Read 0x%" PRIx64 "\n", addr);
-        break;
+        return 0;
     }
 
-    return ret;
+    return tag->ITCAddressMap[index];
 }
 
 static void itc_reconfigure(MIPSITUState *tag)
Signature · 1 line
2.1.0
#2 lore raw
In reply to Leon Alrae
Quoted 22 lines · Leon Alrae

Hi,

Just a single bug-fix for MIPS ITU.

Thanks,
Leon

Cc Peter Maydell <[email protected]>
Cc Aurelien Jarno <[email protected]>

The following changes since commit ead5268f2166101f7dde70598c9f538a90afd8ee:

Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-04-07-tag' into staging (2016-04-07 18:06:14 +0100)

are available in the git repository at:

git://github.com/lalrae/qemu.git tags/mips-20160408

for you to fetch changes up to f2eb665a11a34ac9f6459f8a18c3d9d8be9ca359:

hw/mips_itu: fix off-by-one reported by Coverity (2016-04-08 09:19:26 +0100)

Quoted 7 lines

----------------------------------------------------------------
MIPS patches 2016-04-08

Changes:
* fix off-by-one error in ITU

----------------------------------------------------------------

Applied, thanks.

-- PMM