From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 39A18346760; Fri, 24 Apr 2026 17:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777052364; cv=none; b=OQT+bW//0Go7+Nl29RvD5qqMNo3uf71phLcvvxCh2026ofW8OIqmKRYp+N9SBav1y0csTKxxwGHYwbDSjYS5D6w66wlZfQQZvovpZ3xuuTTrhDWjIvz2gJrQrDUcvck77FxWRgbPuLQG/unbJ16uzMQOQCzpBFBolr4Uz1TKTcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777052364; c=relaxed/simple; bh=cDLJpFn92CqJTxMH9bk80u6JF/HxsNTgQn9D8LmRdGY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ajl9eNRJBxxVbMJTbWoMD/4TDCEIorw2HEOKQeBZ8ND9qLesTQ5mlENt1cKmKXpAAkhmdEX9qNNDgrqAyHjG8MOh8EG3abywUWnvUYG955UABXqn4RJtn5XB8CvN6+xz9URzNGFIVrPjG04RHb/U60QMe1ElOm3cxCNMfI7gDSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XQG+t0wZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XQG+t0wZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0C73FC2BCB0; Fri, 24 Apr 2026 17:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777052364; bh=cDLJpFn92CqJTxMH9bk80u6JF/HxsNTgQn9D8LmRdGY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=XQG+t0wZoNccYos5sPAvALZBFs3h0mQLyNDpXVSYm1BJh2T89DomHSqq83Hdyha3l HQeWs0G9GEbU/XozNTI6Tjf4JArn8B2g3jpshSKB0L8nPPiWAFyjtnFnqc5piEFIGC dCPrRATkcui+pGmrg7XPm/z0Bw7Tw64nEF0S+JMj7Eyf1yYQidv835AeZ9mLr0yRJ4 019zKoQMm3lcXcZClkAPnR4DRCtyuF10kb+F+iJddxsMulhPeYpHevKqqyPLHI1hIX wRdZunJHhGXn+Y3yR3Hgs/p+IhgHlb9VBWtii4dFE+wmf+f98ff8xqOG/87vCJdyX3 tL2czIAiuFH7A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 030B6FED3F2; Fri, 24 Apr 2026 17:39:24 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Fri, 24 Apr 2026 18:40:15 +0100 Subject: [PATCH v4 2/4] dmaengine: dma-axi-dmac: Properly free struct axi_dmac_desc Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260424-dma-dmac-handle-vunmap-v4-2-90f43412fdc0@analog.com> References: <20260424-dma-dmac-handle-vunmap-v4-0-90f43412fdc0@analog.com> In-Reply-To: <20260424-dma-dmac-handle-vunmap-v4-0-90f43412fdc0@analog.com> To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lars-Peter Clausen , Vinod Koul , Frank Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777052415; l=874; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=B1ajbF20z574tNU6MkzXpQc/3VcoJk7X7LFl6JpZA+I=; b=Nk9EiMQtLm+6ZmUJeNmaI3JuixJVaUoxMeiVYrFhwKSQYe3C2gni+dEN3JcG95uWAB3gjCA9J WOoISnGYxZvCdaqLeUPLRAHdgDXo3hK+nH4urVI2lns7ilca1aBM9n3 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: =?utf-8?q?Nuno_S=C3=A1?= Reply-To: nuno.sa@analog.com From: Nuno Sá Use axi_dmac_free_desc() to free fully the descriptor at fail path when call axi_dmac_alloc_desc() in axi_dmac_prep_peripheral_dma_vec(). Fixes: 74609e568670 ("dmaengine: dma-axi-dmac: Implement device_prep_peripheral_dma_vec") Signed-off-by: Nuno Sá --- drivers/dma/dma-axi-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 45c2c8e4bc45..127c3cf80a0e 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -769,7 +769,7 @@ axi_dmac_prep_peripheral_dma_vec(struct dma_chan *c, const struct dma_vec *vecs, for (i = 0; i < nb; i++) { if (!axi_dmac_check_addr(chan, vecs[i].addr) || !axi_dmac_check_len(chan, vecs[i].len)) { - kfree(desc); + axi_dmac_free_desc(desc); return NULL; } -- 2.54.0