From patchwork Tue Aug 13 18:01:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11092727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A23BA1398 for ; Tue, 13 Aug 2019 18:01:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE6726E16 for ; Tue, 13 Aug 2019 18:01:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81B21286A8; Tue, 13 Aug 2019 18:01:21 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35A7726E16 for ; Tue, 13 Aug 2019 18:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727960AbfHMSBR (ORCPT ); Tue, 13 Aug 2019 14:01:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38953 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbfHMSBR (ORCPT ); Tue, 13 Aug 2019 14:01:17 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hxb6f-0007FU-U5; Tue, 13 Aug 2019 18:01:14 +0000 From: Colin King To: Jianyun Li , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: mvumi: fix 32 bit shift of a u32 value Date: Tue, 13 Aug 2019 19:01:13 +0100 Message-Id: <20190813180113.14245-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Currently the top 32 bits of a 64 bit address is being calculated by shifting a u32 twice by 16 bits and then being cast into a 64 bit address. Shifting a u32 twice by 16 bits always ends up with a zero. Fix this by casting the u32 to a 64 bit address first and then shifting it 32 bits. Addresses-Coverity: ("Operands don't affect result") Fixes: f0c568a478f0 ("[SCSI] mvumi: Add Marvell UMI driver") Signed-off-by: Colin Ian King --- drivers/scsi/mvumi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 8906aceda4c4..62df69f1e71e 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -296,7 +296,7 @@ static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba, sgd_getsz(mhba, m_sg, size); phy_addr = (dma_addr_t) m_sg->baseaddr_l | - (dma_addr_t) ((m_sg->baseaddr_h << 16) << 16); + (dma_addr_t) m_sg->baseaddr_h << 32; dma_free_coherent(&mhba->pdev->dev, size, cmd->data_buf, phy_addr);