qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] target-mips queue for 2.6
@ 2016-04-08  9:48 Leon Alrae
  2016-04-08  9:48 ` [Qemu-devel] [PULL 1/1] hw/mips_itu: fix off-by-one reported by Coverity Leon Alrae
  2016-04-08 14:59 ` [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Leon Alrae @ 2016-04-08  9:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Aurelien Jarno

Hi,

Just a single bug-fix for MIPS ITU.

Thanks,
Leon

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Aurelien Jarno <aurelien@aurel32.net>

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(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] hw/mips_itu: fix off-by-one reported by Coverity
  2016-04-08  9:48 [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Leon Alrae
@ 2016-04-08  9:48 ` Leon Alrae
  2016-04-08 14:59 ` [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Alrae @ 2016-04-08  9:48 UTC (permalink / raw)
  To: qemu-devel

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.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
 hw/misc/mips_itu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c
index 8461d23..da54550 100644
--- a/hw/misc/mips_itu.c
+++ b/hw/misc/mips_itu.c
@@ -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)
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] target-mips queue for 2.6
  2016-04-08  9:48 [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Leon Alrae
  2016-04-08  9:48 ` [Qemu-devel] [PULL 1/1] hw/mips_itu: fix off-by-one reported by Coverity Leon Alrae
@ 2016-04-08 14:59 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-04-08 14:59 UTC (permalink / raw)
  To: Leon Alrae; +Cc: QEMU Developers, Aurelien Jarno

On 8 April 2016 at 10:48, Leon Alrae <leon.alrae@imgtec.com> wrote:
> Hi,
>
> Just a single bug-fix for MIPS ITU.
>
> Thanks,
> Leon
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
>
> 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
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-08 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-08  9:48 [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Leon Alrae
2016-04-08  9:48 ` [Qemu-devel] [PULL 1/1] hw/mips_itu: fix off-by-one reported by Coverity Leon Alrae
2016-04-08 14:59 ` [Qemu-devel] [PULL 0/1] target-mips queue for 2.6 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).