Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp354728rdb; Sat, 16 Dec 2023 10:51:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPbVeQK+/fiMZKQRYPakMYlymob8Eo3ful0yPAdVDrPScddRtfx5m7eidYm3jLvxB1gUbV X-Received: by 2002:a17:902:d512:b0:1d0:b32e:c808 with SMTP id b18-20020a170902d51200b001d0b32ec808mr18616875plg.26.1702752681679; Sat, 16 Dec 2023 10:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702752681; cv=none; d=google.com; s=arc-20160816; b=x1dW8aOFfB6GB8WrwO6Jihyntg0wi8Na6fDcgUMgGj681dJiVlqjEQYFK6SDL5229t myPCq/UbMgqU4EGTSQ0XXVhTfpWx2joBn46vAykmentq/mtiCaUpoo01Rqiod6LnzPfy 1pfnOUAR2JVUdByHYyg4SMO9q38LiLDfnAPSchxJdvONI2E3oj2/GftrJAcLaDjPErK7 f+CsLI2kj2K1tbEF1iQoht5E963Pwr31wsqQQW+zaMlTWlFQtO9mquZMiEPPWH9gFiid oGp9qse5ZoX/voZ/mIvGpjr3gJs4SwcgZx581euRNWDfCNTkKuf/KoGsFFqM7+30EbEB vdQg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x7-20020a170902ec8700b001d09249f030si15488546plg.415.2023.12.16.10.51.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 10:51:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2329-linux.lists.archive=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 5030C2852A2 for ; Sat, 16 Dec 2023 18:51:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A703831A66; Sat, 16 Dec 2023 18:51:14 +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 To: "James E . J . Bottomley" , 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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); -- 2.34.1