[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH for 2.10 32/35] timer/pxa2xx: silent warning about out
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH for 2.10 32/35] timer/pxa2xx: silent warning about out-of-bound memory access |
Date: |
Mon, 24 Jul 2017 15:27:48 -0300 |
Unlikely to happen.
hw/timer/pxa2xx_timer.c:145:19: warning: Out of bound memory access (accessed
memory precedes memory block)
counter = counters[n];
^~~~~~~~~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/timer/pxa2xx_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c
index 68ba5a70b3..d47f463636 100644
--- a/hw/timer/pxa2xx_timer.c
+++ b/hw/timer/pxa2xx_timer.c
@@ -139,7 +139,7 @@ static void pxa2xx_timer_update4(void *opaque, uint64_t
now_qemu, int n)
if (s->tm4[n].control & (1 << 7))
counter = n;
else
- counter = counters[n];
+ counter = counters[n & 7];
if (!s->tm4[counter].freq) {
timer_del(s->tm4[n].tm.qtimer);
--
2.13.3
- [Qemu-arm] [PATCH for 2.10 32/35] timer/pxa2xx: silent warning about out-of-bound memory access,
Philippe Mathieu-Daudé <=