From patchwork Mon Oct 24 11:30:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp434407wru; Mon, 24 Oct 2022 05:52:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4a+97GwvUwHVoTfy3CFF8ETuLBpCTWP/guroxNhUTZQjkNAPj+hsJGbk2On+TXpRyqDMbw X-Received: by 2002:a17:906:8a79:b0:78d:9c52:2196 with SMTP id hy25-20020a1709068a7900b0078d9c522196mr27688229ejc.328.1666615929954; Mon, 24 Oct 2022 05:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615929; cv=none; d=google.com; s=arc-20160816; b=frUdbEbex1jM4dPRez1Caqtixpr962v/vBcJOSZEaAjIyvH/hf7B7SWuvKBRhmNRy8 RYhH1u5715UBiNO/0XRUqAq3x6HaoRviT5fpUvNzDBSInErv9zTo+ySs9pNEa06cq1aj 4M2ovAC+4thn4eEKu9wUQGJ1N57e0cF3qVQxfx6sGhdIVB/hmqhOSImzg59ok63p7eCr asOMIYUbRs05YK2Egu1Da9eZFYiLstOv9JYNsq/dHKNd0UTjUfNYZ3WNZKf4l1Z3cNnL 9ZQffMWZDczHP3YA5VZ0VqNgm6MmDhE/oyAVJSIWJm2Wq4OlpoOBH/BVDEFNVXfR2bN6 QuFQ== 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=ui39gpCw0BD6+auaLEiZ0UWrgFwJVtSDPWaD/1llSok=; b=Dqt9tczMoT92yJyvwviHH9b/S33+JOhYaVpNaQkE41EzHGi64r3t1Oy5+R/ywagSRK z9XD1GYmRMLGzIRG738OfkxJGROUHV2pZ6twTkPJbJyrddrCWYpPZndoqMcpVZ5nlNB3 MHLg3LmSamnDwRZKqJzI3ly5ilTQFV0YFqqWMAT40cJ0KcXL2dV9/f3f3qg8EYWbuCGM zSeUBUz2nksn4nDHtFfs37S/tsP0LnCtlz0YFFOikYMHBs0td54vC3kbe3lzSt/EYgzG 3KrPUqPwKfmGWnXnqTHed/zYCjizT4dEWwWdoORwA7KkeCxGbReFLoRGSI4RH0iQZumv Yrhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bkfhLekG; 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 js13-20020a17090797cd00b00782f3e3bb71si15110590ejc.912.2022.10.24.05.51.44; Mon, 24 Oct 2022 05:52:09 -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=bkfhLekG; 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 S234271AbiJXMue (ORCPT + 99 others); Mon, 24 Oct 2022 08:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234589AbiJXMpL (ORCPT ); Mon, 24 Oct 2022 08:45:11 -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 CD6922F01D; Mon, 24 Oct 2022 05:09:53 -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 9EA9A6129D; Mon, 24 Oct 2022 12:09:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5EF2C433D6; Mon, 24 Oct 2022 12:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613348; bh=ZrsYK6Nl2EM2TgK2s+s0ekaPojcy+Op5hVt+uaDoDp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkfhLekGj1NiNV+3WBWy8cQNLmrob0z49U4VDyVXPgiGuZ9JHAMRSsww9wiKl0IaI Gm+EH15uX9gy+V6YzcohLotbDdjzML7rXE9bgT2Aot4lkJb7lxTbmr8+UZkMs3ms9J 8cwyXPRT4UB8wtP6KcX5ns9tHnVGzPs/BZhDtJhw= 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.4 103/255] mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() Date: Mon, 24 Oct 2022 13:30:13 +0200 Message-Id: <20221024113005.892591461@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573465321452084?= X-GMAIL-MSGID: =?utf-8?q?1747573465321452084?= 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 2c4ba1fa4bbf..d774068dba30 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: