Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1260747rwb; Thu, 22 Sep 2022 12:22:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nuhcNtHafFoGviwfv+dsxPPK3gXgYgQQW5+P33EAfqvkEZ9x6uZ6mYaBN/B40Zu8+J4Oj X-Received: by 2002:a05:6402:1d55:b0:451:756e:439d with SMTP id dz21-20020a0564021d5500b00451756e439dmr4885447edb.226.1663874528703; Thu, 22 Sep 2022 12:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663874528; cv=none; d=google.com; s=arc-20160816; b=iDuTWqXTVGVWNHSkey7Y6RJmrHgzZiBp+SbiO1Y16Z1zY/q2arEOxXdyBfWNf4RVaH NkxjX4K9HRhubt6TEcWL1vSMEiVmpCgBKKEg9oJNuJw1cH8xb4zUnZp/ERSx8RwVFsKt yvI9yXs8btT7pF9/3YhzSN8oHl2mfuZUA1QuvW1iKhTzzfxzek/89gFNzXFdtbmON4HK /yaWONtDAb/ioOf6EOF1mhKeht9gkmczMzPCYYhPBLAyD2oGIo0mzFVPHV6lpUR5rnwI eOyj+kiSJ378KnITmi5B0QwRvVv9jbxyq/caqPS3BiarNXYROzDemEmolMxlTlfC/akJ Nvlg== 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=39BctwrvZ0ymZ8gui0eYq8y69qzkHeVBclkFpRX1dH8=; b=it2l5RzyvoMF4Ku6aHpdUDVx+XwvHAIFh/hoKj4biaUj9s+NWfCXorMnM0iY9amHcE V6syscFB9N7GbIPEB2jlCHCTJTWZDer9R+7/kbrxVstynMoqcWMunM8+WeBESMg1agm6 guZMt/eEVNB0BpyVGmt99T78j8U1lNTSIChn5FpdS/ElnwRed7yxu6e2iE7r5BbfxvGh b6+PoCXaCnge4wxbUnmaf60LOCstniUQ2mOTS3o8GLxQJ2P0HXSEl+fJo8+5uU5eZqE8 nTXlxPVEm5j30XACukgfiwXzzYYb1c8zCei91uzEn53QJxCh8JBHTXyWcfWKuAw86mVt cz1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc5-20020a1709071c0500b00730a1069b72si6588696ejc.684.2022.09.22.12.21.42; Thu, 22 Sep 2022 12:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbiIVTGw (ORCPT + 99 others); Thu, 22 Sep 2022 15:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbiIVTGu (ORCPT ); Thu, 22 Sep 2022 15:06:50 -0400 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92636EBBDA for ; Thu, 22 Sep 2022 12:06:48 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id bRWzoFS7XOizNbRWzoX4NW; Thu, 22 Sep 2022 21:06:46 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 22 Sep 2022 21:06:46 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: ulf.hansson@linaro.org, cjb@laptop.org, dan.carpenter@oracle.com Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Thu, 22 Sep 2022 21:06:40 +0200 Message-Id: <53fc6ffa5d1c428fefeae7d313cf4a669c3a1e98.1663873255.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A dma_free_coherent() call is missing in the error handling path of the probe, as already done in the remove function. Fixes: 3a96dff0f828 ("mmc: SD/MMC Host Controller for Wondermedia WM8505/WM8650") Signed-off-by: Christophe JAILLET --- Changes since v1: * Add and use the (ugly named) 'fail5_and_a_half' label [Dan Carpenter ] v1: https://lore.kernel.org/all/bf2e2e69226b20d173cce66287f59488fd47474b.1646588375.git.christophe.jaillet@wanadoo.fr/ --- drivers/mmc/host/wmt-sdmmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c index 163ac9df8cca..9b5c503e3a3f 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -846,7 +846,7 @@ static int wmt_mci_probe(struct platform_device *pdev) if (IS_ERR(priv->clk_sdmmc)) { dev_err(&pdev->dev, "Error getting clock\n"); ret = PTR_ERR(priv->clk_sdmmc); - goto fail5; + goto fail5_and_a_half; } ret = clk_prepare_enable(priv->clk_sdmmc); @@ -863,6 +863,9 @@ static int wmt_mci_probe(struct platform_device *pdev) return 0; fail6: clk_put(priv->clk_sdmmc); +fail5_and_a_half: + dma_free_coherent(&pdev->dev, mmc->max_blk_count * 16, + priv->dma_desc_buffer, priv->dma_desc_device_addr); fail5: free_irq(dma_irq, priv); fail4: -- 2.34.1