From patchwork Mon Oct 24 11:30: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: 8596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419406wru; Mon, 24 Oct 2022 05:16:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4de0Ew3GiHj34r2h7wuN64VTMVJywHiwhK+w9Itf8lwqN0tTePubp7jH4d0NCeUDC3ACat X-Received: by 2002:a05:6402:2744:b0:45c:9978:eae8 with SMTP id z4-20020a056402274400b0045c9978eae8mr30770890edd.361.1666613774800; Mon, 24 Oct 2022 05:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613774; cv=none; d=google.com; s=arc-20160816; b=WTt6op+8p5pCbieq2rrVlUcArF/M3adYJvo3WDmVys/uyPjdjilT9XFloBEdIGVk6C z1FRqt6xxhPCqSpxTfUiSr4erNtWmSsIuj27psvhj3ZvMfjvilnntFlIK6MlBSQOe5NE 5f8cEnUNLYKOYZevnEMryxHw3xRWUB+xKAsXx8dVua1wknODH0zKef7kdFCXPFzQithz 981hMEUJcnHqWQ30VYBclB9kffsVx1w/95ULtNFrUvHGeQ+KlGMLerk0agPZ3f/JkLZ+ aKhCpWy8IyDEvkGv2nnA1pgBM3zqj111lD5Jv0f3+PQNM2pkX7cLTsd3wcU9pjrTqyJN tiiw== 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=fLMQi09DfP9PeWJ0Y6ykVLwzF6oMcwEYiN4AkbxL/II=; b=aUi7AVFFZvv6Pxbb0FpKchMILr9HuB3oFOs6VmV6cGkVhxa0KVEWffnnQ6ohOfMI3M OguRE+GnGCO+6XHuFhrQihdWZyzoeqNUINbtzevzVyTW+zI87rjrOzlhNB2DlD9kQ5SH PcAURJtij54lvd2Ed6qBAMdy9zQ5WgP8d2wMUM/MqjeZgUWCNmdghXKmNtyONTPwd0uL 0pUBe/HAZ84XToJisslSABUoffYNGpwgmjJMYaFTQE+kDMuMJ3mG+LLFROU9qNrGtV5f G91BqFsFjHFQyu9++TioouLQ8SUiINxZ+z+4TTAzgwJ99LYiDX+oGjhcOk9ha0u8rQdM xDMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zAg7tOYV; 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 qw20-20020a1709066a1400b0078dad5e8d65si24286151ejc.68.2022.10.24.05.15.50; Mon, 24 Oct 2022 05:16:14 -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=zAg7tOYV; 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 S232761AbiJXMHr (ORCPT + 99 others); Mon, 24 Oct 2022 08:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbiJXMFE (ORCPT ); Mon, 24 Oct 2022 08:05:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A00B7CE24; Mon, 24 Oct 2022 04:51:18 -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 1AC68612D6; Mon, 24 Oct 2022 11:51:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 279C3C4347C; Mon, 24 Oct 2022 11:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612276; bh=8qIvuZtQBIn+XzpoaTxZT9Xx9bczzWsukg2GyFCA1/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zAg7tOYVjaEZqY8LOD1/8ne7NWQI9+q2mSO7PjlAvGisTEMsYiPAo9iAkRqMBkxBB mXworgjbbsuriasqwgmfRabXAh2YYAEYthaWKOso3YB2qpT+T48sEecfc66rmHC23p SY+EAKbYKtTMCorJmDgKAoEAH002Y1Nz/sqhj2/E= 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.14 105/210] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Mon, 24 Oct 2022 13:30:22 +0200 Message-Id: <20221024113000.422320989@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747571205095305313?= X-GMAIL-MSGID: =?utf-8?q?1747571205095305313?= 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 fd30ac7da5e5..85cad20b2ae8 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: