Message ID | 20231216185006.19200-1-rand.sec96@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp377443dyi; Sat, 16 Dec 2023 10:51:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHK9nTrHmEEqumOxOscsp+vFnz3vHksmG6c4vOBNl2iH5QwU84d9Z3Mxah017uarIiOzZH7 X-Received: by 2002:a05:6a00:4613:b0:6cd:dc48:1fff with SMTP id ko19-20020a056a00461300b006cddc481fffmr19648604pfb.0.1702752689583; Sat, 16 Dec 2023 10:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702752689; cv=none; d=google.com; s=arc-20160816; b=leCha3hIfMdevOWpLVuoQBod72PG77xZOJ12PNViDPRsPPGxNcrIrgvTcjUynoffT2 U8hgPoxifaVDKzMJ/msTHrr0DCGr85yonIjN7pAWJMtFJoZY1E/5kKqFxFjfGqXeGWYn rC18SszM4lpyIw1RzHiZSS0ObW1/XYgUtf63yRt+ziIU4tEQd/NqYAuzo25iEiFt2SDk vXvEXBgQGvp2YnR5iTEmUXqwoSFAmDCOZKoLulXqTmxj01MeJZRXxfW6Wp/SHe6GGzwy Qhy0wvI0ZRulrjsTYdanQmvqbEShuiwWu4glQZ+2+PflRnIeJOqI8LIv55bJta+JO26Q ZbfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Lyyk7PYn5UsLoIP5w0Df/PxhFykyWSZXEGZH2I4+NT4=; fh=inLDu4wrHmIjzG19MKuwVe8kXYXics+tPXS2BXX7CC4=; b=YRDMffAqwk0Rv40ckyfYHle4f/UWXMKaHnUWZzTQC2FT2Ds40k+PbMVcz0NrteTmV6 jp34+F8/fjKBDYIXV3lNCRC2BuJtnLWBr6vKik9yPRM7Z6J5YfbmGXmnayOc8NWspBRQ Nb/DpmuYzPxIhEk8lvUNNuWTAo2tUYkfALEF4VqRS2kaHBA9hPNemjAPLHP8XKCiUb89 bv/5ALOtXQuJE+doc4dY+0KTn/SgLU4TLULIvqP91NMV/2JTKhAA39o9pWYHjWw9Z4Uj ThUi7IekPuwJF+rDh2iaUoD0lj0vUQBwa15Ap1rWy79DbpoENFfTgvnl6xQWteRT58Sx HbrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A+xhS1H/"; spf=pass (google.com: domain of linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 20-20020a630f54000000b005ca4684b4ddsi6805569pgp.498.2023.12.16.10.51.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 10:51:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A+xhS1H/"; spf=pass (google.com: domain of linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2329-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 05A502853FD for <ouuuleilei@gmail.com>; Sat, 16 Dec 2023 18:51:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97FA631A8E; Sat, 16 Dec 2023 18:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A+xhS1H/" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EFBD1E4B3; Sat, 16 Dec 2023 18:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-50be24167efso1896508e87.3; Sat, 16 Dec 2023 10:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702752670; x=1703357470; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Lyyk7PYn5UsLoIP5w0Df/PxhFykyWSZXEGZH2I4+NT4=; b=A+xhS1H//GsPHa2H8xWFtam+0QoDACp5NDFtD0kf+LpmnZiYNs+pr5maGSL43ApkXs NyeDFBEffbo6uhzgeeoor0+A0SxbR049v13quQbDrfnzPCKwoU14bz8CtXg60hQ8aWUR A6+ssMi0d+k5zTseNGYC4Yet2qHTQN8Ve10Dv+bifqCMUK06GBYryvmkqJfFDQz0iUW2 cLi3tH87BilsCYJb+RWFP10m3czbjgHSyizc4kQ6KxX1AOzUOrhtGBxyfKEakh4lDA8B JjYyzRyIZv4cTp3wUqlxINVLkr0/pv4S6BcAvTQk957gIl9vIx8III0B3g6FM32qAiat fjHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702752670; x=1703357470; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Lyyk7PYn5UsLoIP5w0Df/PxhFykyWSZXEGZH2I4+NT4=; b=tXkFqcr+88fZTASuYFkQ6m6gIems3mcHsYAly16jiY+RMsTWkAh1K4hbp+DKvk8E7i xk2Nz0IKcBvxRAF1mdRjPx1oAO4OCSwHPwKfNThhkgDg6iFQcgNgYgThpHYlPfKh2+is 0eSrx5ZnlHusAO2Saz90zecyMulAeInKvrYVrVHb6fDqhua0vTwFj3O57DtZOV/Ek5h6 +rqImKZiGXdg0cCZFdzHQyhNsDWNibPgi9VJY+rvlinh9xwec80rhc4Pg3xSqvSK8dLC AM36BRY8tVipxu8VOcX6zVsGfOOO14qY8TUULiz8EZWWPFFQ1zIV5UXfT+1Aciyytpw4 g70Q== X-Gm-Message-State: AOJu0YxJ0mHXm9BK+c0itxKrDW99MjK3F7EzKGiXsjbW1axDFB8jd7+4 VXZ+EHzoiDl6IW2+im8Ka2k= X-Received: by 2002:a19:8c14:0:b0:50e:20af:2297 with SMTP id o20-20020a198c14000000b0050e20af2297mr503110lfd.255.1702752670176; Sat, 16 Dec 2023 10:51:10 -0800 (PST) Received: from rand-ubuntu-development.dl.local (mail.confident.ru. [85.114.29.218]) by smtp.gmail.com with ESMTPSA id y21-20020a196415000000b0050e150ccee2sm838303lfb.267.2023.12.16.10.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 10:51:09 -0800 (PST) From: Rand Deeb <rand.sec96@gmail.com> To: "James E . J . Bottomley" <jejb@linux.ibm.com>, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: deeb.rand@confident.ru, lvc-project@linuxtesting.org, voskresenski.stanislav@confident.ru, Rand Deeb <rand.sec96@gmail.com> Subject: [PATCH] scsi: fix calculation of phy_addr in mvumi_delete_internal_cmd Date: Sat, 16 Dec 2023 21:50:06 +0300 Message-Id: <20231216185006.19200-1-rand.sec96@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785465604166159128 X-GMAIL-MSGID: 1785465604166159128 |
Series |
scsi: fix calculation of phy_addr in mvumi_delete_internal_cmd
|
|
Commit Message
Rand Deeb
Dec. 16, 2023, 6:50 p.m. UTC
The calculation of phy_addr in mvumi_delete_internal_cmd contained an issue
where the expression '(dma_addr_t) ((m_sg->baseaddr_h << 16) << 16)' was used.
This expression was found to be incorrect and useless because it always evaluates
to zero, regardless of the actual value of m_sg->baseaddr_h since it's u32.
This commit resolves the issue by placing the casting inside the brackets, making it
more meaningful: (((dma_addr_t) m_sg->baseaddr_h << 16) << 16)
The corrected expression ensures that phy_addr is calculated correctly and
addresses the previous issue, preventing the unnecessary use of a zero value.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
---
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 0354898d7cac..675ea5dcaa21 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 << 16) << 16); dma_free_coherent(&mhba->pdev->dev, size, cmd->data_buf, phy_addr);