Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp11456pxb; Fri, 15 Jan 2021 04:37:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUp2q881+rIo+u82ScROQSjJIq0CwOJ4lz/XOej6JoAVEOIfWRtp503h2+Rr+z4Hmxe8OT X-Received: by 2002:a17:907:1701:: with SMTP id le1mr8882641ejc.68.1610714267351; Fri, 15 Jan 2021 04:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610714267; cv=none; d=google.com; s=arc-20160816; b=yZQ9PG7G/k6Wu8Vq6mqjV5Ux0r7JF0P10knDr4H8LPogVwsLCk7W4H495oTKAsrYYt YlYHRVwO/KjEigQwC8b/m0T0pLmDFd8P5J1Dk/EWzQmRrf5arkyhuZ8Nj3/aejngfDV3 AtgtiV+RNVeJVwYosN8PCxi7+KxSmAaXTj28W2jVkdiQdXkn2fUwZk9bEpd34Pnia35/ z4lMUdfVBTI3LDtcyZssZg/eB++MGSMTOydqr4Rtkns9k2pdy+dOsuQs10oKNUfw+7wR dc76P7mD+Vj32GEepwMLHj7290iF/GlKoA7jlbmIRkexLI2+nFTQGSjiIroxGmnD1LDl zh2w== 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=ZFRUgDDAO9UjKS7a9I7GND7JTcdCf1SCIAsXQJvtJDI=; b=hhj+8wFCQbaCyE0sGQsC6uuRVYUwuqK52kq5U277sLLgjUad/HfmNw5T1ChXTvloWg 6Fb8pDuURzt6U+sJdXzjvkCWKCz+Fr9NjXT9MCZsGsUKL3aBEQDmO3uVGfAoFBf65s0D +ri64PS72V407DiHassNvIuRm075aQvTSlpy9TKtpF4BAEhUNOI5NSIsRxaBiWSxQcpB Gm1uIjyQAdElMys9CTuBWZAmFLIAvKMDbw3kSvs/sWByMtpn3lGU8BGQxpsuRjXeetyZ aVadcSxfqKUO8kd31gYi5SQn3KoGN9ysOg9S6vOWTKQYVN/oCv3V1Jml1TmjJfBqfZic aHFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DOF0UgUm; 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 ca10si3826256edb.435.2021.01.15.04.37.23; Fri, 15 Jan 2021 04:37:47 -0800 (PST) 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=DOF0UgUm; 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 S2387716AbhAOMfj (ORCPT + 99 others); Fri, 15 Jan 2021 07:35:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:42672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729990AbhAOMfh (ORCPT ); Fri, 15 Jan 2021 07:35:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37DA2236FB; Fri, 15 Jan 2021 12:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714096; bh=rSih70okvAofANG/VIkYzxE2fl9zFMm++0vCfDGt0EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOF0UgUmm5MmUwvWVAvlx/yyzJpt8aEvdgfn59Ayy9VAnG9TJyB+Yv5Y6lICUsfws AjVsLGtCVqanHGvSuE3E4SlJUimbx5NQtEIdTrRWjPAoNgZO8sBOGdn5K3cBLJLxkd Nwa74iLF7eI7pcB05gjGF3s/9r2xoWuVhVLvZhVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Vinod Koul Subject: [PATCH 5.4 43/62] dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function Date: Fri, 15 Jan 2021 13:28:05 +0100 Message-Id: <20210115122000.478035318@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121958.391610178@linuxfoundation.org> References: <20210115121958.391610178@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 33cbd54dc515cc04b5a603603414222b4bb1448d upstream. 'mtk_hsdma_hw_deinit()' should be called in the error handling path of the probe function to undo a previous 'mtk_hsdma_hw_init()' call, as already done in the remove function. Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20201219124718.182664-1-christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/mediatek/mtk-hsdma.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/dma/mediatek/mtk-hsdma.c +++ b/drivers/dma/mediatek/mtk-hsdma.c @@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platfo return 0; err_free: + mtk_hsdma_hw_deinit(hsdma); of_dma_controller_free(pdev->dev.of_node); err_unregister: dma_async_device_unregister(dd);