Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3324898rwa; Tue, 23 Aug 2022 02:52:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR73V4wZYhsq8yc6PyTWvrMPDiejjMtg9y3zayoDJC/TgumNucBjlj2BlA/YpgPdB6oAg5Ze X-Received: by 2002:a17:907:1c9b:b0:73d:62e2:f1ec with SMTP id nb27-20020a1709071c9b00b0073d62e2f1ecmr10397086ejc.60.1661248356934; Tue, 23 Aug 2022 02:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248356; cv=none; d=google.com; s=arc-20160816; b=K/KhXutKZcyCSs+p3B47Ldi0HGjX6uFh9OkzoXqJm0Z+k8p5Paf7/JYp6BDvy9Zb9X Ht6cvvIDKey1wqBzAozQ3GV5c5sizmwES0O39GQ9j6oOZkoxgpb/HBYnoIWTBCoYMkih MaulQ8l4tQr2+yOa5Kg7W34G19OMDknJLZNIm8lkEYPFnMr6LXCltHonR7Qt5zo/JVP9 RRvZt9K8NyezEVdKU8Hhup//BqEUeLk3es7Uw7EYhlOPaz1yOs/vjFaKJNBbNFJyolzn Qcbl8EoCKrjZQMUwmMmG32bxa1aMIbh0ggK8kX/y5kvl6LVe2ZeB0TI8+ADhyWCFwY6P 8+VA== 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=myS8ILhN/+zqOZqGSUAijUMBCXEGxVkEUteqb3kxuSQ=; b=pEBSXNn31P0SjYSEHbO4BWS58UwDbwFdNN4ZS4Cllck6P9bQKEzSgAfp1SQlAE3+j2 extKe66ULun7XE8L5Vgb3P2c5m05L6Os0nghepwLMIMSmYKmYAnCnZxclCgYtTAEBDg2 3fngeNrIzF2DPjMSQpB0w5gxMyITIWpjA5NcmqAU9l5UDgLbm9f1yN144J2v1LplywaH ZryX1D4Nqr4YFT+wPUynfDhbGU6x17pTuXOmohezhCZ7CFffLaNI3GwmAz5BqweNyXJG Sf6MeNsuhcWUQymWOqKvaPwFe8w45wOiz5pYP7uklARjiOYLl8xzvkYqAEbXVOOqnTRE PDhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GMo9e2Zj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a50998e000000b00445f2dfacaasi1496452edb.614.2022.08.23.02.52.11; Tue, 23 Aug 2022 02:52: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=GMo9e2Zj; 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 S1351595AbiHWJh7 (ORCPT + 99 others); Tue, 23 Aug 2022 05:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352002AbiHWJgN (ORCPT ); Tue, 23 Aug 2022 05:36:13 -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 7043896FD1; Tue, 23 Aug 2022 01:40:09 -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 B18946152E; Tue, 23 Aug 2022 08:39:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A47FAC433C1; Tue, 23 Aug 2022 08:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243952; bh=Q0I/PmJguM5EbQjnODE386mN8aRsJ1nboBw3Kf2fsGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GMo9e2Zj3ESrlQGmpv6A2/6W+3H9ixOe8kt1BYlB6z8OBwVL37BhfWJci+PpypHTb vSeNzHLm55fSa3iBtzEorR+tLRby1EB4gsn2Zdgf8GlUBqOpB5V5ErcQNhVtvuvTos 8FM7aRQBCsdM/E7EesO8ysU4Cnv77tFmv1mRhUL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Ulf Hansson Subject: [PATCH 5.15 013/244] mmc: meson-gx: Fix an error handling path in meson_mmc_probe() Date: Tue, 23 Aug 2022 10:22:52 +0200 Message-Id: <20220823080059.522885537@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Christophe JAILLET commit b3e1cf31154136da855f3cb6117c17eb0b6bcfb4 upstream. The commit in Fixes has introduced a new error handling which should goto the existing error handling path. Otherwise some resources leak. Fixes: 19c6beaa064c ("mmc: meson-gx: add device reset") Signed-off-by: Christophe JAILLET Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/be4b863bacf323521ba3a02efdc4fca9cdedd1a6.1659855351.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/meson-gx-mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -1172,8 +1172,10 @@ static int meson_mmc_probe(struct platfo } ret = device_reset_optional(&pdev->dev); - if (ret) - return dev_err_probe(&pdev->dev, ret, "device reset failed\n"); + if (ret) { + dev_err_probe(&pdev->dev, ret, "device reset failed\n"); + goto free_host; + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->regs = devm_ioremap_resource(&pdev->dev, res);