From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C970746DFE5; Tue, 21 Jul 2026 17:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656719; cv=none; b=bZlmc4uFI5HkmTX9QLhBWSokV3T6ilXOWmxO6jtqlwX/iKuH76oObsHUpe2+AfXX+F9OOFlPhl+NNXku8l3vMLpR+gQIlswFf6kdrTrZPWMhz8/j5hjEs948t5iyy15M4zL/CSO8BLPMGB2foneXtn66+0etlXpiHaRGcPkxVDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656719; c=relaxed/simple; bh=Evkys2WlkFo/VARyZK1eEBL/cH9IQ88VLkLu4shxTl8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JbhnvhgI22RHKax/j3QyeBkDRngefPt7fd77s7PuqzpzLYCVKuv+HoaLYFW15NgWqFSKYVSmiRANGP3pnrxKUToN40LUD+h1sdIMZxeh1J9+O44XhF+sHPWNO87eH/uoj8sAVgvIYTrbFlTMYOyiQxx0K5Y8VfHtzqRdYhtvFfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xuD0pr9s; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xuD0pr9s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10CF51F000E9; Tue, 21 Jul 2026 17:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784656718; bh=AF5KFNumMxP97bZTzQK8uDR9k6nWSFM6E+yiING9Kz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xuD0pr9scxcqnGMunl7nFs0kUQi74XYjwbXpzSpuiElTV2D71NbmujCUELoVrXgj8 7UmWgaBDG3Dn1fkjrX0oYicSwZkj6gmdOy9D4Ogdhk6DTX/AEsnxmy1tQ2Y5RMUoSN RjseAeoWO1r73W1qmVclM1Pajy2/cX/eQ6ToZUcI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Gu , Herbert Xu , Sasha Levin Subject: [PATCH 6.18 0493/1611] crypto: marvell/octeontx - fix DMA cleanup using wrong loop index Date: Tue, 21 Jul 2026 17:10:09 +0200 Message-ID: <20260721152526.431020906@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Gu [ Upstream commit 7891c64c0520519782470ba29bac8a5761e295d8 ] The sg_cleanup path used list[i] instead of list[j] when unmapping DMA buffers, leaking successfully mapped entries and repeatedly unmapping the failed one. Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT") Signed-off-by: Felix Gu Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c b/drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c index c80baf1ad90b2f..89030e2711ce41 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c +++ b/drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c @@ -157,8 +157,8 @@ static inline int setup_sgio_components(struct pci_dev *pdev, sg_cleanup: for (j = 0; j < i; j++) { if (list[j].dma_addr) { - dma_unmap_single(&pdev->dev, list[i].dma_addr, - list[i].size, DMA_BIDIRECTIONAL); + dma_unmap_single(&pdev->dev, list[j].dma_addr, + list[j].size, DMA_BIDIRECTIONAL); } list[j].dma_addr = 0; -- 2.53.0