Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2698821pxj; Mon, 31 May 2021 08:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpqtbr/WJ7UouOPlSD0O6ZCboty8h6alroU5VRIjlHinSD4LpmHF9r0YyRblvxeggRhkzQ X-Received: by 2002:a17:906:3b92:: with SMTP id u18mr23460403ejf.450.1622475124835; Mon, 31 May 2021 08:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475124; cv=none; d=google.com; s=arc-20160816; b=jS5Q9G2v92DiH0IqJ5bLEIYgIADTbr9aMN1mUGN8Lo4+3wbNAT3633BBGCRcFlv/iy Vg+yGlvxx3Q3O6YzKp5S2AoRPOQBAVFqjcgcQpCqpQ3VUaOLtm6vktsa+hU0+Tgom1QD xXBI1w2L6qT13YJaowauIvFdz2bw2Xvz+rlKGylo+s8SRI1qSRW1kecgj5f3isIll6+C hFDI4olwVrw5n5sRN03wy2pWiiYYrTjaKESQzWmUwIvGMHYcrnBAble/+4ZWvi0f65z6 WEc3gcAQUTcYsAK0McFaGRIkv8x+fnMqTuG1L8TEecSyz7eD/qh1q+xwlhIZ69j6f/Op F5AA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p803V/xOzb4qc/hePcK5wrQeSZ0XnFpi3LzglZa1jAg=; b=FuMEbNuz/o7ZYOTr/ZbvkfVqjkphpp9sPEuvkIKuxHLEbxmWAfl7GduB6LtTvPYK3t LUxLMyQTO7MAMx9XZ1nrKe8qFVP8VKExW2bm52402rsAaHImPnZ1GuKiBX531wnB94o7 C7isjszmpYh8SBenkwyYK0s1yb8L2ulJtCOb0PuXrDKxWrNGHifXvdanCCAgr2piRi6Y ldbGHxBdjrWbJ721icECnkkofD8bHEwpFBae3bdWJyH2eKK01Qqfhr7hAVGxTtW70t9i jnNObLhQjYkjBIECh0ElxjZSNLyoB2/yWWsQaBVRWytvogcZVY0vBHozz5ElArfmo1sA heIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDefkMS3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si12959424ejc.676.2021.05.31.08.31.42; Mon, 31 May 2021 08:32:04 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDefkMS3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234882AbhEaPaH (ORCPT + 99 others); Mon, 31 May 2021 11:30:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:46126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233490AbhEaOTI (ORCPT ); Mon, 31 May 2021 10:19:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F3B96141B; Mon, 31 May 2021 13:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468666; bh=iKyYyDpShslT+5GNriDpMu/Gpkxx0at5Xw/695kRCUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDefkMS3ffRpEioOv5I01dlfvQxrkhm8IpuhfatBsRczWIFboACT68xYupFPhi9+v cz4hQ+Ha+va6M1itPY2jcGZXRBGjY36tuIEHThGSY/DiWvmIISvV4U13hxcQQJxQnC 6S/RSCpH8naV7QNLLoU7dr0L/Yrw7mJRVTqJSwqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Vladimir Oltean , Mark Brown Subject: [PATCH 5.4 078/177] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Date: Mon, 31 May 2021 15:13:55 +0200 Message-Id: <20210531130650.595202706@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET commit 680ec0549a055eb464dce6ffb4bfb736ef87236e upstream. '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 Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/d51caaac747277a1099ba8dea07acd85435b857e.1620587472.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-fsl-dspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1142,11 +1142,13 @@ poll_mode: 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);