Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp245967lqp; Sat, 8 Jun 2024 14:33:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCwFibvtnbhSoPlN7rV8jKZ6lsb2RHa3ub+tXxEdVaDw/e0wZntiA0GP7czxMkFXUKo3KVKcHNd7U9PdGC19z6aJI/9bFLKP/fmik1jw== X-Google-Smtp-Source: AGHT+IEMk1duTpVp2pXkBVYUC/FYuoyDjP6HRLiRWqwoDm19D90u22l7ZgjddEgbFjowA02gNsKr X-Received: by 2002:ac8:5a86:0:b0:440:24f1:6824 with SMTP id d75a77b69052e-44041c432femr64746521cf.22.1717882393109; Sat, 08 Jun 2024 14:33:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717882393; cv=pass; d=google.com; s=arc-20160816; b=GUfXvS6ytNyYqre0gai9B6ZboCH85HTxkjshcmMNqijezGrnXeTX+epwkKwQVS77Lq tgVrZTRxRIjeZNdbyPIAir22vVUP7A+1SuLFtsqn+SxAq3fujxpSQk/gQce8KABREDKS lz6rk+rvILooX/Q7ik2IbYFIilyAs1tIOjXAcdUjxaVGGU+oVzjd0Uva5A6dB+xhCtWL eqLrQD4vHA6UVQGaUV0HbT2c85a5Oe2CmAGgYNbiq/pJmPUAFkAPmpB3SC4t8GPvqQEO iNQuQka2k59PlsgSbtj3IA1RmDOHoZwq6IwQ9Z4j6u9JkyI0euHaDQomsROTbumkBcHn TZxA== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tu++zvi3hy03WnBvFMzNx4Almv3OZW4GRR+MRySyAmA=; fh=3Nl5vC3zcxbm4jNSR/MIHm43WKgG4I4f97IhmG11JsM=; b=XZIwrYtzISRWIX7VE6k6dSbY40mdh0w5kQfhqMH7SaQPJVskjn4nJGdKldzHO4B3BJ HIm1h1IjgWer8z3ogmILQo4agReIivxs9A3VfWRfLIqcuMh2XmDjFAEA3vzTbC2INXqV oeICcZ7uYe9dajskO6gp/ZeiTIrVoHYqWacdtlxGFy6feJSOJa1i2JsUSJueHfPIRku4 fFmeMj3CPrIgKuIrGEXmT8ywSPrye+IvKCgIqCCoDJojzTaFZSlZeYSADBVofp86E8rE kSA1RAlCSg6vhz4nACcr3T4APz404JLesjNc8VVaXoK7qIRyFRJaWbU9cT9DYu2pvpQ1 EVaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h2TXtVV6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6f4a1si73169511cf.45.2024.06.08.14.33.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 14:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h2TXtVV6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207207-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BEDDC1C20B5C for ; Sat, 8 Jun 2024 21:33:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31FFD3D0D5; Sat, 8 Jun 2024 21:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h2TXtVV6" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 CE8EB1B947; Sat, 8 Jun 2024 21:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717882368; cv=none; b=hmxn21tydkRxISqwg+eBRGnqoF7J/n4F3HLzD6ggxbpwG4GDB+AYlm1xl283pBSOppi2YODuVtcTMg9I/UgKshgcyt9d9M/bwOHCo1AKo2Gv660qyMXqcgfXgMRqKutbpo0pJIqtA8cKA28bbv8guAOr9rss4nVZzGUJXQLVvJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717882368; c=relaxed/simple; bh=+Rs8wYwBoiG3K7IcsS1TPmK0AG2mOW1LQ3u5KD71wcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ulAl5cv1w5gEBITyicpuL1tlcU7KjIzrUwGI35FPeBz6/RNikWDGEtvP0s11NRZa1ZU5gLeWS6pzb3lTAxcsT2fNwcyOFrltmGem4hs74h36ssoqF7HtRFV0kO50xoyjYH26GFLw1i5NKDW7POdNTA/T2bvHK8CvovOe9yii1e8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h2TXtVV6; arc=none smtp.client-ip=209.85.221.44 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-wr1-f44.google.com with SMTP id ffacd0b85a97d-35dc1d8867eso2563133f8f.0; Sat, 08 Jun 2024 14:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717882365; x=1718487165; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tu++zvi3hy03WnBvFMzNx4Almv3OZW4GRR+MRySyAmA=; b=h2TXtVV6mxPS/scq3Sod+ZfH35T+r1L4hCsj7wgE+3ThiOrNYHr0qtF+93939bO5FF XOPXDJSRQ2QrvAhPrCacPrpbXrVjY+FfxXY1u/R3u2GroRqbjuM8zWtY/k/Ut9zEA8Cm /6v0hNCu2d+3IuS9R7GlDNVxy/erauI6RIGXhoA1Q9g3O+Pdj2v7jkZWGvYzAkgtYXY8 R5gr+dfi28M4gnZ50uDQLT7tZ53aqNnL0kFMLviC3NwPzCp3s722cc6iRQZ1ZPykhloz WfsvZ1UybkGToiIeZRYrj7edN/7WkM0obK83XjP3et35kA+TCDC/i7Xb34DXPuYMMEgp KDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717882365; x=1718487165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tu++zvi3hy03WnBvFMzNx4Almv3OZW4GRR+MRySyAmA=; b=uMe9B4zerh56RPSyti1XI2uLrbSTGJCRGELtNeCoRQntARu5H7uTNeACVbpin5foYa 5eDP2cDgPo8+x3Gx4cXOIvDGjGfOuSKG2+0UPd9e5lCxH/PKnUQ9GrtGd6td7hZgXG6B L8eikj6TqrLME9Dsa+cI0jiarPKk5/yBCzJS7rxbgGdI75dO2mMx86F2cj8OmYKv+rnY XeODFunybPHtHYU2crJwAqsCQaq+pCO3icUpVUNb50+MmR8vmQJgXRUX2u94kLu2H2Ek wFk7P30YNoAuVKdYEVoNDqyK1ls72frjuJ35Oh4Z0o1LphMbZEXrG7KV0Mx3kRszwnQB wB/A== X-Forwarded-Encrypted: i=1; AJvYcCXYcmTqYm9GjAQ9i0mK0Gtc2C4gcSJ1g5mKqd6a9QwuP+rl6OtsdEV5HeuuH8qleq1ZCGIuSwv/L0zQiCpm2QC8wIE456oQnQQL X-Gm-Message-State: AOJu0Yy5egtFXYVuIVcw/u4QBQXPMirT87fOtOF7mocoYaZhERQSyXRJ 0AHzZU369jx0hpyOETCzeu1i6stpd/HS84qJn65kgcFLhuQOwgYI X-Received: by 2002:a5d:42c8:0:b0:35f:1f19:594d with SMTP id ffacd0b85a97d-35f1f1959aamr220070f8f.33.1717882365133; Sat, 08 Jun 2024 14:32:45 -0700 (PDT) Received: from localhost.localdomain (oliv-cloud.duckdns.org. [78.196.47.215]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-35f116540d5sm2793247f8f.15.2024.06.08.14.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 14:32:44 -0700 (PDT) From: Olivier Dautricourt To: Stefan Roese , Vinod Koul Cc: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eric Schwarz , Olivier Dautricourt Subject: [PATCH v2 3/3] dmaengine: altera-msgdma: properly free descriptor in msgdma_free_descriptor Date: Sat, 8 Jun 2024 23:31:48 +0200 Message-ID: <20240608213216.25087-3-olivierdautricourt@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240608213216.25087-1-olivierdautricourt@gmail.com> References: <20240608213216.25087-1-olivierdautricourt@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove list_del call in msgdma_chan_desc_cleanup, this should be the role of msgdma_free_descriptor. In consequence replace list_add_tail with list_move_tail in msgdma_free_descriptor. This fixes the path: msgdma_free_chan_resources -> msgdma_free_descriptors -> msgdma_free_desc_list -> msgdma_free_descriptor which does not correctly free the descriptors as first nodes were not removed from the list. Signed-off-by: Olivier Dautricourt Tested-by: Olivier Dautricourt --- drivers/dma/altera-msgdma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c index f32453c97dac..0968176f323d 100644 --- a/drivers/dma/altera-msgdma.c +++ b/drivers/dma/altera-msgdma.c @@ -233,7 +233,7 @@ static void msgdma_free_descriptor(struct msgdma_device *mdev, struct msgdma_sw_desc *child, *next; mdev->desc_free_cnt++; - list_add_tail(&desc->node, &mdev->free_list); + list_move_tail(&desc->node, &mdev->free_list); list_for_each_entry_safe(child, next, &desc->tx_list, node) { mdev->desc_free_cnt++; list_move_tail(&child->node, &mdev->free_list); @@ -590,8 +590,6 @@ static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev) list_for_each_entry_safe(desc, next, &mdev->done_list, node) { struct dmaengine_desc_callback cb; - list_del(&desc->node); - dmaengine_desc_get_callback(&desc->async_tx, &cb); if (dmaengine_desc_callback_valid(&cb)) { spin_unlock_irqrestore(&mdev->lock, irqflags); -- 2.45.0