From patchwork Wed Oct 19 08:28:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5577 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp352190wrs; Wed, 19 Oct 2022 07:16:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4CtK2XGN98q6/xj40ooAToG5iXT5R+9ScyIMjyWZONJuhSthpCr88Mlcf58nlqCLV5vHdR X-Received: by 2002:a05:6402:169a:b0:458:fe61:d3b4 with SMTP id a26-20020a056402169a00b00458fe61d3b4mr7572387edv.140.1666188987431; Wed, 19 Oct 2022 07:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188987; cv=none; d=google.com; s=arc-20160816; b=APJDeZCw4XbtoigDQ3u+in1UJ7oNSPIpmnXFVNF1fRPj7kjO39K59j1aHINq6ALQ3Y Hgj6Ep8QbYAdko0FPCqkwSOvo938bfasPIaG8YvyY3yarpIWyotNDlPOD9aHUtT4VgrI u7gTSpNFL6NwS5ZR+aNaaiEry4DIgVKgN5sX0DfXmhYkX0hfckOBLB2pONyWl27CGqes 71eGJbxa+mcCK8r80+qCUJiYCGD8aQ2pqeO27LzYl9Ta+mYLfG9Ief45D+s3fkNKe6df mZtQ4wkGTchk9QDRQL9eYLdVeLEC9EaVQW1zy6kylavyU8kJ3MlJxFS81yFpF8k7pjJo rAbA== 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=e9lNr+H1z+TBY4qPt9flhsBUy54Qfh7ytYkFhy/TOBPvEW2s6uyzu5hBpbjdNjCzvU WX5Tmxg/VyhHdnvrdPl3tWHsX3MXnsnjm+ZluyhgtKe53SLBofttilgh0iYORnzZbqBo lnVs30OdoyfqNpn0WjaUzTj1oH5sH1gU7ZhIZQKovvmsgPNMhyCqbuCDyqkYWe8H2nYn CIqFQboBgjBv/9xXAs0iW2Du6I/HhPuHcuhYOIxshR9wtFSMkG/xbTD/hqOWiuPoxaIL 5PH2J2FBoPMZ5Bh19mSxcXOJgiP20opGZhQgEljpYn/QCO9ryHbN9jBtt2WZZeWuxdaB bYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L3jvUQLp; 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 g14-20020a1709065d0e00b0078219af8361si13662319ejt.883.2022.10.19.07.15.50; Wed, 19 Oct 2022 07:16:27 -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=L3jvUQLp; 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 S231844AbiJSN6i (ORCPT + 99 others); Wed, 19 Oct 2022 09:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234044AbiJSNyk (ORCPT ); Wed, 19 Oct 2022 09:54:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E433F132DD5; Wed, 19 Oct 2022 06:37:37 -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 9C427B823FB; Wed, 19 Oct 2022 08:56:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F5CFC433C1; Wed, 19 Oct 2022 08:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169779; bh=HHebO/JQrjiVOVr4n+bmDjcuNofUzDO5209bu/y3qb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L3jvUQLpR7Xl54flkM3dZjrg4z8itK7c2CJ4K+JzVJd+At7v4CFN2HV+qgf6U4tzI 2mN9avwKmbmuWMZvVVQOf/SUZFN4EcWNL40Z3H47ldEv6PsYcc4tinVX+MUbLwHeLB jlap0cgdDVsrNvd/bRBrGC/mFBOlL1ppq0otGoyA= 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 6.0 404/862] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Wed, 19 Oct 2022 10:28:11 +0200 Message-Id: <20221019083307.789744074@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747125784115074514?= X-GMAIL-MSGID: =?utf-8?q?1747125784115074514?= 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: