From patchwork Sat Jan 15 12:45:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12714382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9666FC433EF for ; Sat, 15 Jan 2022 12:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/ve8E02Q/Y9P70dG3q0xptIzH1hxGeSr3/Lic4N4Kn8=; b=wBnyHJI6tNfsMT ZxOLuAUOQIC0/Mjwhjzpu685qozJYUI0F+WYEjYU9CByj2PauIq/9tMxyPBZ739CHP/sVKEaqLw+j mEUnD4I0xVLxvhG+Auh21YUN8PHBdnDAKc4fy2JiYzMDd05w6R5NNWugQDo7JbDYLQwGWsOYsYhif snl9BZJaUB2IXGylBNYE4Ef9/8F2h4E6MzBHe3Gk5iWhtyWKOKcNT0e+NdJ1r9Psl89RGBonMdy7Y wZy7QrlL/WCSKlfmWbmuPUw3bxF8zztzLJktCmIm2P1mUVjuX38u6aNSyGievaSC2G3b1clbVoVq9 wQl17jvqT/Cw9LX2AQEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8iQv-00B2wf-EQ; Sat, 15 Jan 2022 12:45:25 +0000 Received: from smtp10.smtpout.orange.fr ([80.12.242.132] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8iQr-00B2wK-OU for linux-arm-kernel@lists.infradead.org; Sat, 15 Jan 2022 12:45:23 +0000 Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id 8iQinzVVSIz5V8iQinfmtS; Sat, 15 Jan 2022 13:45:18 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 15 Jan 2022 13:45:18 +0100 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Conley Lee Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH] net: ethernet: sun4i-emac: Fix an error handling path in emac_probe() Date: Sat, 15 Jan 2022 13:45:03 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220115_044521_960649_161F37A5 X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A dma_request_chan() call is hidden in emac_configure_dma(). It must be released in the probe if an error occurs, as already done in the remove function. Add the corresponding dma_release_channel() call. Fixes: 47869e82c8b8 ("sun4i-emac.c: add dma support") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/allwinner/sun4i-emac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 74635a6fa8ca..621ce742ad21 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -1072,6 +1072,7 @@ static int emac_probe(struct platform_device *pdev) clk_disable_unprepare(db->clk); out_dispose_mapping: irq_dispose_mapping(ndev->irq); + dma_release_channel(db->rx_chan); out_iounmap: iounmap(db->membase); out: