From patchwork Sat Oct 22 07:23:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096783wrr; Sat, 22 Oct 2022 01:05:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GsGxkqro5g9LO+KSgrv1zi6iUlR/ucurgrpL7uGdXjgYEjA4gkK9cPiLzKLjlNADjKXko X-Received: by 2002:a17:90b:1644:b0:20d:459b:9d81 with SMTP id il4-20020a17090b164400b0020d459b9d81mr26480667pjb.196.1666425958534; Sat, 22 Oct 2022 01:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425958; cv=none; d=google.com; s=arc-20160816; b=ysK2RilPlFS1+h54rBGuONv4x89G2iI9qCKoSyD+9lgyo4vpga/muQgcz5b+b5ZKLu XDyd5/FcPOz73AjfUu1pilJ4aI5nyruN8V8Cn8TtC3nbQ4zBAO8PlY3cqrAJ/3fwq4hV itBGm+uCXrGheRRZ6ecD95UGq4FTJIPVsaldP4EWseXkCJJ7fxnxdLS8AA4Xb6yZ/oJX FsMPLFWsPr9vvIy9ErrK5mlW7Rd4iAQSn6QUJaaHB4wZyu4PkMcXHI8t0+WtO5jlEogI O6PmHspPhZDtG26S7fg09UcczVRI6MQux7GH+FvJYRNQ23LmglQIDDmtd1+l/fOExkS2 2t6Q== 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=QJQp++MzUms/1JVp2+81Qm4114iR+ppLOFcZgdXVtis=; b=D2y2NLRqZw7SLPfJPDmaThIPnw8P098uookBdChEoAYdPCxomGdf3oETpLj1ZnI2vW T9NnMxzRxzc9hJcSvu0WnDzcOCvri7rMXxWdWK1cuBElxKEPWtzNTihaHjidhW71xer6 K7SkTadMPrz+/ZAGYTXsf78os+pjGMS5d5TVx6ziU8y82FxtJpB5OOvRKMiY1NgqE02W DZhwtz76A0ztlFKaukzIk8UBlnpuMtHO84iBPDNrx2tjrvwcnXaw9XyWtFCimKyIpMLF b+blSLykNF+VnvSyRti4YzKR6Xdf8QI1wWQNXHZzTb03tjhTHf8JBDLu3v/Yx1Mss+VM HWTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDenJxzs; 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 66-20020a630245000000b0046ea4ef43d2si7413840pgc.378.2022.10.22.01.05.42; Sat, 22 Oct 2022 01:05:58 -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=CDenJxzs; 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 S230416AbiJVIFO (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232500AbiJVH7F (ORCPT ); Sat, 22 Oct 2022 03:59:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE158260A; Sat, 22 Oct 2022 00:49:20 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 010E160B28; Sat, 22 Oct 2022 07:49:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E9F9C433C1; Sat, 22 Oct 2022 07:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424955; bh=HHebO/JQrjiVOVr4n+bmDjcuNofUzDO5209bu/y3qb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDenJxzs3wkxg5hgxfvcgrn3jO3EYQ/ngGuhvNazWBgVjyHeGNjUKGNK11mi+bcZ4 DsRNinCjIifJaW4qKic9o1KhhEEM3r1SIOsuL1lUyMLgF3FDF5MX81litgNlxAIzft /Hs7MNU8x+rsHnscof4vXQzl37gl0VWwVjnA0Hkg= 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.19 339/717] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Sat, 22 Oct 2022 09:23:38 +0200 Message-Id: <20221022072510.368646260@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374265936025741?= X-GMAIL-MSGID: =?utf-8?q?1747374265936025741?= 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 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: