Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2016109pxj; Sun, 9 May 2021 12:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMoV2wngI1GCccSKljbem6pAxsNuWLatP2ji2Iw1Kouu3bfM79WRD8RCNeP3giZJKxGASx X-Received: by 2002:a17:906:fa86:: with SMTP id lt6mr21635468ejb.547.1620587743367; Sun, 09 May 2021 12:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620587743; cv=none; d=google.com; s=arc-20160816; b=bIBdj70DU+O2dq4LFY95Fn9DqqDUhtmJXpDkjH2bCsy+NDMt1ktkqLysShih0cMXyA 97bVhEiUZr7rc1n94093hJQBoloYv+1kne8QkrwmnlNv6hfJg/scJxDQU6dFljCe8cDj BDLtb6Vy+QUt8p1DQRIkxCDLzXkO1XNJGHuzKOPKzhLa8fgNANeNxeHzYrccqG13C7y7 VZROD65Tgow9Y7zU2M+BOho+TE/Cj5/P+GpHW1QGFZDAqgRufgbaafLvRcvPdnX72avc 1z8idtv4tWDisgK5vVwuIhzvyoBm1Y+JBVb5uRbmo0wSSXgrJXR9igQjZmRcf5t0xunZ Pm9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cZIQ21HxGE8sQwa4larR5n+DdWDQQhqnmrikfzYeV04=; b=Vcnplyc2qCaVJKkdY2AljypSM5rZA4U07pTUO3gtH3ldYxfDw6ER2SQthlpz6VgYOv 2AGdbXl9y3jsz6kbSHJxPKDA3H598FBEvNS8pRPpnj8WIs+s3YBjCOHBzmBQprexINcL hxGpd1zg7TzCqXNZh6BlDHgsTn0ysi3GQPIhf0lM+00PEoIoFlr7/H4j2B1IgnUc2Pzh 59eQs+GezSA4bIN+lMlascx1uAXCHezLB2Nedes6xPHf0cp9vm3w/Qkaz5cKgolmQuvA uK8njnnzBpu/TzNqIcbiz0CONn491/xjucRww1GZ3YWnqdAvSiBmm4M2zo8DTGUO7ge0 bkhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg8si11694724ejb.649.2021.05.09.12.15.19; Sun, 09 May 2021 12:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbhEITNf (ORCPT + 99 others); Sun, 9 May 2021 15:13:35 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:31786 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbhEITNd (ORCPT ); Sun, 9 May 2021 15:13:33 -0400 Received: from localhost.localdomain ([86.243.172.93]) by mwinf5d60 with ME id 2jCT2500B21Fzsu03jCU58; Sun, 09 May 2021 21:12:28 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 09 May 2021 21:12:28 +0200 X-ME-IP: 86.243.172.93 From: Christophe JAILLET To: olteanv@gmail.com, broonie@kernel.org, maitysanchayan@gmail.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Date: Sun, 9 May 2021 21:12:27 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the error handling path of the probe function, as already done in the remove function Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Signed-off-by: Christophe JAILLET --- drivers/spi/spi-fsl-dspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 028736687488..fb45e6af6638 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1375,11 +1375,13 @@ static int dspi_probe(struct platform_device *pdev) ret = spi_register_controller(ctlr); if (ret != 0) { dev_err(&pdev->dev, "Problem registering DSPI ctlr\n"); - goto out_free_irq; + goto out_release_dma; } return ret; +out_release_dma: + dspi_release_dma(dspi); out_free_irq: if (dspi->irq) free_irq(dspi->irq, dspi); -- 2.30.2