Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1068549rdb; Sun, 7 Jan 2024 02:02:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7dWIBRQt5njVEcnmTHbv7cKkupbPgffcOkekP2KTc7lqiIjR6tvuPhfisqZBpbDJKSEtt X-Received: by 2002:a05:6e02:218b:b0:35f:cace:45cc with SMTP id j11-20020a056e02218b00b0035fcace45ccmr3961325ila.67.1704621779653; Sun, 07 Jan 2024 02:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704621779; cv=none; d=google.com; s=arc-20160816; b=NLlIwyde41VNuDb7L8NXeJ/xHyc45jy9Gt3vJsGHRt+/fibjIY4qhxQJDRbf4m4G/M WuD+xgKOuNVOJgADnNpGDmYcIv4PM01J+VGoZH3PaaCjfjIXXhzyxtRSBLwPjWyX4VUX kMxpAEJkwSa0vk1PH3d93z7wtpca/KsysN67spwEixntbUdd8DVDj4FkWm6aAnsqG6mw USzHBzsNjOemDxOF9CoQzHZ8bizT79iWpsEm7ItWbl67Xfxp3uZxhK592wQOVZg4R3tc jwn+iEQIuJNAmCRJfo3mGIqxwSYLzZ0z9AIjD2jobhBmS10a6GXvZjpRd+xHsACqvDMV CQXQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aJxzVqIgfQ6I8zkGzF9gzvRPzwUJvo/hE6MLhe9DP3E=; fh=dNnfSg18Ptr+OweKY4QKN/WRiJyhS4OXToJzVPS7qUI=; b=ZtzeRegThB/Uw6wC2eunR27PSLZ8gXBQmPKTZc1n90c8eQKFC5EaXBquSA3MMbKDvH IMBBs4eTeAjLoTnnyZyPYjTREEWgaiwSLuUDgod19jC8T6X+aM+1GbJ4Tk1QAHV5N5eN nMNA0ryr1HhZ6nvVrFcQwGvOjWUMHorYQlRW9/gJWqqe1rHf2rnuN2QlABXYB5vNYXkU CxhSImiyPTaE7ga2pwH2QZzyiCLh9VtUAmXDo/1Yo4WaS46b0iG2z0BxWkR0Ybf/00Gw pQfsEcS9ezayRujt7WupxvggBxQRZHTGOoAP2VIranAubufyPIbclQPUw7ZQIU8bR4sc jnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=NVbya2GM; spf=pass (google.com: domain of linux-kernel+bounces-18830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 9-20020a631149000000b005cdec4d997fsi4147946pgr.539.2024.01.07.02.02.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 02:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=NVbya2GM; spf=pass (google.com: domain of linux-kernel+bounces-18830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 940CCB218B1 for ; Sun, 7 Jan 2024 10:02:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81B28134BC; Sun, 7 Jan 2024 10:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="NVbya2GM" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) (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 C00F9134A0 for ; Sun, 7 Jan 2024 10:02:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id MPysrRwtE9WXyMPz3rZ58J; Sun, 07 Jan 2024 11:02:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1704621742; bh=aJxzVqIgfQ6I8zkGzF9gzvRPzwUJvo/hE6MLhe9DP3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NVbya2GMo5OoRxXFFv5NHUY1L5eI3ttmziRZBoCzBx3k2g4l0RVemOhW3s3ev15Xv JP/ka/4sMZzNpbbS8uvsrd3/rztuz7RryCRIJMQGZFUSLh8VnkKFzr7RVGnExUiksG DEXImPZ8BoBYIrbooWiLi9qNF1goQR+I9HAlwxQVfMQVLwrQCadDteRFR7XJL6CKOO LlUeOs+jWHBgAkrJt5vBJGUAHhaAlVRss9zch1nNUEm58zs3yDixHuNLxi6zKqJo/6 bChNKkx+GYaL1pRF5lQXh79VqNUNTWZRIU6ShctpGHEUEtsiVfFhuGCBmZo2vjYwSJ 9G/EdahnL8X9g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 07 Jan 2024 11:02:22 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: vkoul@kernel.org, jiaheng.fan@nxp.com, peng.ma@nxp.com, wen.he_1@nxp.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/3] dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA Date: Sun, 7 Jan 2024 11:02:04 +0100 Message-Id: <7f66aa14f59d32b13672dde28602b47deb294e1f.1704621515.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This dma_alloc_coherent() is undone neither in the remove function, nor in the error handling path of fsl_qdma_probe(). Switch to the managed version to fix both issues. Fixes: b092529e0aa0 ("dmaengine: fsl-qdma: Add qDMA controller driver for Layerscape SoCs") Signed-off-by: Christophe JAILLET --- drivers/dma/fsl-qdma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index 38409e06040a..3a5595a1d442 100644 --- a/drivers/dma/fsl-qdma.c +++ b/drivers/dma/fsl-qdma.c @@ -514,11 +514,11 @@ static struct fsl_qdma_queue queue_temp = queue_head + i + (j * queue_num); queue_temp->cq = - dma_alloc_coherent(&pdev->dev, - sizeof(struct fsl_qdma_format) * - queue_size[i], - &queue_temp->bus_addr, - GFP_KERNEL); + dmam_alloc_coherent(&pdev->dev, + sizeof(struct fsl_qdma_format) * + queue_size[i], + &queue_temp->bus_addr, + GFP_KERNEL); if (!queue_temp->cq) return NULL; queue_temp->block_base = fsl_qdma->block_base + -- 2.34.1