From patchwork Mon Oct 24 11:30:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8770 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp430462wru; Mon, 24 Oct 2022 05:41:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OVc9qTEHzqq7GcU2SH1cnZAJTnd3AM5zyzJDLOF4clZiRYj98UDwJKFSuktuewfdE2QWi X-Received: by 2002:a05:6a00:230d:b0:53d:c198:6ad7 with SMTP id h13-20020a056a00230d00b0053dc1986ad7mr34037911pfh.67.1666615296718; Mon, 24 Oct 2022 05:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615296; cv=none; d=google.com; s=arc-20160816; b=KodePqWVH4m6UGjPcUrLdTunaN88DnIEXpHLw1NZbvsb4cI+e72yE72eLJ5Pjgwpqq fX0Hg3rWKCWcdB5uY7uV4TYf3sn7IvCrn9wBzFpjqyzS/3kFfGlZ/7VMV5yEorYrolwz SJ6et/ajFXIgtoHqwfWy7jDn3k4rBDpsyYvRaFOEEfqnMBALqJHNqWVqLwuZJ8f+ZjpX sH3PEduR2f9nc8TODV9R7Kh3T9uDvkS4kzo8sg/4Ga0yjA6QW/76qO4bPWDzKGxtzHem ah8Po8SFufwP8h//qhnHL0bRjkUMpkPxK5sbwsRY71BXi7FXtARWAphXDSGXgcycVSac CkXA== 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=85z7WzhthObm3CdCzfnxN7PSrcianPB12xz91lMo878=; b=Ji1l3WAM11Z6sSpxr0VdDrmk18YjEYsvk01Lni6iZR4ZMKNxuEcI26JKYBHrgPjXUb qTfoangX4N9kjU2AFf+ZHOxfxoy0vZJzWd9VfqIBwyXdsNQSAnWF2kNBi+0PfWhH3Etr bJdV/gf8Rf78JVSCoUwJOvQ2IwbSdbAaRzjIPZfwmTo1xxgjEJshz8FNRQMztzRh2Bbq qvDoM7VN8pKxCyy8Z/ctFkGH5W4sY474HKzo2llhFxF7n78Z7KBQBDKXOCoDRYn6rE43 OnLV8/7d8KEjEyrWx2Lk5MHKzvnuKKNiWPp+G7PE0Qi6UGzptIgzPI1nweTOjyg19yGD Y7Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iVWT1Ja0; 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 s9-20020a170902b18900b0017f8d9b7e5fsi32404278plr.133.2022.10.24.05.41.23; Mon, 24 Oct 2022 05:41:36 -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=iVWT1Ja0; 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 S231787AbiJXMbR (ORCPT + 99 others); Mon, 24 Oct 2022 08:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233898AbiJXM2g (ORCPT ); Mon, 24 Oct 2022 08:28:36 -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 DFF6A86FB6; Mon, 24 Oct 2022 05:02:33 -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 E8B69B811F9; Mon, 24 Oct 2022 11:59:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51B85C433C1; Mon, 24 Oct 2022 11:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612748; bh=/Q6pzcrZjDpFolWBJ1EYpKlo1jaPwZnnnU4E+ObCcyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVWT1Ja01s3mP/O0VjBUjiEQ6ddoskRzJ051ziBcGSxWlBcI8+BU8v+wNQBPopK7g o+68xzEEWI+Ix5peVX6OS4t4U6bZxIGMlu72NprpwOzLC6c3GboWVz7cOemyhNha/9 DVFv6F2NaD3rMOOxTdpdcPZK7qxryDW8R6IUi/gE= 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 4.19 104/229] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Mon, 24 Oct 2022 13:30:23 +0200 Message-Id: <20221024113002.382124113@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747572801231064410?= X-GMAIL-MSGID: =?utf-8?q?1747572801231064410?= 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 3ba42f508014..f8b169684693 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -853,7 +853,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); @@ -870,6 +870,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: