From patchwork Fri Oct 14 09:51:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 9376337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7ABC6022E for ; Fri, 14 Oct 2016 09:52:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A910B2A5DF for ; Fri, 14 Oct 2016 09:52:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D7FB2A5E1; Fri, 14 Oct 2016 09:52:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 044522A5DF for ; Fri, 14 Oct 2016 09:52:34 +0000 (UTC) Received: from localhost ([::1]:46299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buzAH-0007Ua-Qh for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Oct 2016 05:52:33 -0400 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 Received: from ssl.serverraum.org ([2a01:4f8:130:84d6::1:2]:47347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buz9v-0005ol-K9; Fri, 14 Oct 2016 05:52:11 -0400 Received: from mwalle01.kse.adk.loc (unknown [194.25.174.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id D4C082226C; Fri, 14 Oct 2016 11:52:04 +0200 (CEST) Authentication-Results: ssl.serverraum.org; dmarc=none header.from=walle.cc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1476438725; bh=Oqd9BzCJJqln+PV2AheoBgPJLy624Jyo6EwTlYFEJVU=; h=From:To:Cc:Subject:Date:From; b=Ucq0/JKr7PBCv6bf++P/o0upvIkZeHMLPDikLaKycpsWk7VofIj0L/vBZPkX40nQ1 eRYjWAULzBU5CDRyrWphU19QafkDSKuuZSHJTHj12TNYPM3U4wcKB2yE0bsYIvBeBw qEuH6Ok/En+/OA1A/ElyiAgtblbpcvizTrIn2PTA= From: Michael Walle To: qemu-devel@nongnu.org Date: Fri, 14 Oct 2016 11:51:50 +0200 Message-Id: <1476438710-9226-1-git-send-email-michael@walle.cc> X-Mailer: git-send-email 2.1.4 X-Virus-Scanned: clamav-milter 0.99.2 at web X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:130:84d6::1:2 Subject: [Qemu-devel] [PATCH] milkymist-pfpu: fix potential integer overflow X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Walle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);