From patchwork Mon Oct 24 11:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9691 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp543838wru; Mon, 24 Oct 2022 09:30:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yC+z3ohqDIaFc5VgOMrs7EhL8l2LIXyyS4ijbxPpaAHaw0zTdz2NTQbH3AJVo6HFqbIvP X-Received: by 2002:a05:6402:3890:b0:45c:2b5:b622 with SMTP id fd16-20020a056402389000b0045c02b5b622mr32063909edb.69.1666629047520; Mon, 24 Oct 2022 09:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629047; cv=none; d=google.com; s=arc-20160816; b=wXBLH3cglhGe9BNtq8Enr5VAFpagIk9RJQZCijvVeHpO9KBWI/qjtB2UuM1jneVAHb nNgO+MYRRTyot+Xa8wvcFL7491+0/8/wHt6ps4cDaEZo/ejN+wt3aGFF457m0qA5RYUz 2gEDviDJ0FXE4hVcaTgog3JwaSHf0r/yz5Ox+Bn4HrF4nPQ2CidukgF5RjdenrlxbrBo kNL2HETI5EA03nTrYMr4gbt+BV1uKj3x2mghLbbka53Y8SBOY2Q6XgOf9XlweBV5mjIJ 8ydSMd08hN+6XHUb2zQFp/9dt/qTykZ4lB/Js9fwiq5tujEgoC0weq8F6OrGfYltOwKL mypw== 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=6xN/jyiUsQdnbPfyAYHVHe1KHGv5xsBfcQBKJcwyWuw=; b=tcACJRF9tEPbPcFjerKA06wvP+EA0Tt25YaBhecW8dktoEW5adoCn2057NCUeB6KMW /K79d8bphor6Vurzcw8izPbkN3N+1tz3IThwmAKlifQyRhYk1zuad5r3xWeWTWSxVH/Y L2pRuHtzdzmpW9qYNuk+rrtvLxYwm8R0F3PFilsrgqKlAA3JDsvWZLBc5s8My3gJj9Tf aL08s8NScLdT6MC8pwMqJIC1htOuzT3hoAn7lYCRev4jX6NqbsVncQL3Yv2jWQf/2uow vlF0R9fHsoilQ6iMKR8plXc5PvZ8z+6VD0e5at6VnFyCLp3sGdWKCUZk0lIhwMptcPf7 /Ktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PQOxZWZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h41-20020a0564020ea900b00447dfae6181si189110eda.235.2022.10.24.09.30.23; Mon, 24 Oct 2022 09:30:47 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PQOxZWZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233678AbiJXQP5 (ORCPT + 99 others); Mon, 24 Oct 2022 12:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231566AbiJXQMc (ORCPT ); Mon, 24 Oct 2022 12:12:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F872303EC; Mon, 24 Oct 2022 08:01:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 079A3B81662; Mon, 24 Oct 2022 12:23:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EE29C433D7; Mon, 24 Oct 2022 12:23:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614184; bh=kJzoIagnr6iTBQpAuXXRmG5H3xo8e2I+NFwdsmxml8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQOxZWZw09+XoZ11vr11iwEW+JV3hBcDOXFp11MzbGzVgZSQK5xWphcZ/zGynTkBA wbB8781SeZPLRUhkfN39WaQkdQKqKjxia/KHob5a3q/WhDL3WnvcxkuKz+J5uY8RTw vVxMV+J7LoRrfW+sFQwlBj8kpZEE3kXahXqFhrbE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Dan Carpenter , Ulf Hansson , Sasha Levin Subject: [PATCH 5.10 165/390] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Mon, 24 Oct 2022 13:29:22 +0200 Message-Id: <20221024113029.736175615@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747587219950975594?= X-GMAIL-MSGID: =?utf-8?q?1747587219950975594?= From: Christophe JAILLET [ Upstream commit cb58188ad90a61784a56a64f5107faaf2ad323e7 ] 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 Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/53fc6ffa5d1c428fefeae7d313cf4a669c3a1e98.1663873255.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- 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 cf10949fb0ac..8df722ec57ed 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -849,7 +849,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); @@ -866,6 +866,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: