From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buzA2-0007U6-01 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 05:52:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buz9v-0005qI-V4 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 05:52:16 -0400 From: Michael Walle Date: Fri, 14 Oct 2016 11:51:50 +0200 Message-Id: <1476438710-9226-1-git-send-email-michael@walle.cc> Subject: [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, 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 --- 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