qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow
@ 2016-10-14  9:51 Michael Walle
  2016-10-15 12:51 ` Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Walle @ 2016-10-14  9:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Michael Walle

Since the lm32 is a 32 bit architecture, just return a 32 bit value which
is then converted to a 64 bit value.

Spotted by coverity, CID 1005506.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 hw/misc/milkymist-pfpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c
index 1da21a6..3ca2589 100644
--- a/hw/misc/milkymist-pfpu.c
+++ b/hw/misc/milkymist-pfpu.c
@@ -137,7 +137,7 @@ struct MilkymistPFPUState {
 };
 typedef struct MilkymistPFPUState MilkymistPFPUState;
 
-static inline hwaddr
+static inline uint32_t
 get_dma_address(uint32_t base, uint32_t x, uint32_t y)
 {
     return base + 8 * (128 * y + x);
-- 
2.1.4

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

* Re: [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow
  2016-10-14  9:51 [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow Michael Walle
@ 2016-10-15 12:51 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2016-10-15 12:51 UTC (permalink / raw)
  To: Michael Walle, qemu-devel; +Cc: qemu-trivial, Peter Maydell

14.10.2016 12:51, Michael Walle wrote:
> Since the lm32 is a 32 bit architecture, just return a 32 bit value which
> is then converted to a 64 bit value.
>
> Spotted by coverity, CID 1005506.

Applied to -trivial, thank you!

/mjt

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

end of thread, other threads:[~2016-10-15 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14  9:51 [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow Michael Walle
2016-10-15 12:51 ` Michael Tokarev

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