Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3390959rwd; Sat, 10 Jun 2023 06:59:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nCDW4dARk01FkMXEXkXX5uA4ihf9/jokR8evmsvYzPwImmY23yrAIy45pnghs3pAEFIzy X-Received: by 2002:a17:902:8493:b0:1b3:a928:18e4 with SMTP id c19-20020a170902849300b001b3a92818e4mr1309488plo.58.1686405577306; Sat, 10 Jun 2023 06:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686405577; cv=none; d=google.com; s=arc-20160816; b=WAK6ZUy8JQHhz/04vcHU7IzQZXL9ibHAWXQingUTQIZ8ih4tDWW6EzncLfHf7fFNj4 idJAkWg2ywND+vyZ4zoSomUcdTZQgLPE1ZW5uiswlv2Kxf5LBWWmxxGXsgxBcyfM+fTw auR4zqFMd/Y7fNsnhS1q98tIztwPY4s3eFjAMdi0SfzPtXjBpff3V6oGNuH3C5o3NFFw HjdEDRKjsjVLW0TlYAGc1ObP/izue7QBEz4UBr3qa2PwIzRmP4R3zraDHIUaHiExpqCH 9bvwZYO8LHLG/YgjVx3UbZg3qRDWDzhKPz4F1pqZkM8qSUOjOL7/IjOmzxTqpCAkSNaz J13w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kw2eOSJ4V5gSFaEZFeVcNGutktWcvfZoGnpsREiIJQQ=; b=eMj0520VU+LUdiTBTfJIw/0/WXqxOjbSFCLS1Nlhf1cFWjKf1PCWfPfHzAcNI9pRV1 9fhuaYG5K/BgvSrJENsSnHETQDdP5vZNe76RZhtDoS0ldEdU/A5cAxbSWptYRDYLRDmK FCS+SNSgArz7ZBpGJBfKIokqOBkLXQM7qXCJKo2pKekLLvFx5hR0fOWlVwyH2+EI5VYd zRU4AGSly57i9lzeXALJVVUzVPg8PVYJWindcSZfJkgTD/AMcyaQotJVfY1i2nRS7Ydb 9k908WgQnv1/hmhKJHEBFRJLtIIXhskyq6skoJ3FcPJAKRg2llZsjnN7FA7n3PP1IilL S4OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=UtCoAA5s; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id le15-20020a170902fb0f00b001b049aae135si333681plb.246.2023.06.10.06.59.25; Sat, 10 Jun 2023 06:59:37 -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=@wanadoo.fr header.s=t20230301 header.b=UtCoAA5s; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbjFJNdC (ORCPT + 99 others); Sat, 10 Jun 2023 09:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjFJNdB (ORCPT ); Sat, 10 Jun 2023 09:33:01 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB7A30F4 for ; Sat, 10 Jun 2023 06:32:59 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 7yi5qGFtQVKwS7yi5qth7a; Sat, 10 Jun 2023 15:32:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1686403976; bh=kw2eOSJ4V5gSFaEZFeVcNGutktWcvfZoGnpsREiIJQQ=; h=From:To:Cc:Subject:Date; b=UtCoAA5syEW/TxvW4W3YpIYtZSU51UIR9jSTzm0tptj+Llh8jKD4DCGH2QIA/fsut 1zufdLSmvyXqCzcKqAPUMBblgm0zfyf/C2QGvVj9rQGax99LWOMO8tLpSGZEsv+x2Q +BILiaTpujcAaEUs+x/SfrZngrnu2oTmR6MApU+YNNPXA1vuRecdft8E5GNVsXvkx1 tol9LhHVe+ETUjfgYK0xGEPM/0MPOZRifUkRoLRns0UtbUCQT9n8l7SnNoN4uljYZb 0XH7n06C+3ARMwBK3GMAgjj0iIq4RIhOEih4M7KbTX1+HsyC1Vh9V076htHamhKxT6 HaiiVWE4x5riw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 10 Jun 2023 15:32:56 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Thinh Nguyen , Greg Kroah-Hartman , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Felipe Balbi , Yue Wang , Hanjie Lin Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH] usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe() Date: Sat, 10 Jun 2023 15:32:52 +0200 Message-Id: <9d28466de1808ccc756b4cc25fc72c482d133d13.1686403934.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 If dwc3_meson_g12a_otg_init() fails, resources allocated by the previous of_platform_populate() call should be released, as already done in the error handling path. Fixes: 1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue") Signed-off-by: Christophe JAILLET --- drivers/usb/dwc3/dwc3-meson-g12a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 365aec00d302..e99c7489dba0 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -796,7 +796,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ret = dwc3_meson_g12a_otg_init(pdev, priv); if (ret) - goto err_phys_power; + goto err_plat_depopulate; pm_runtime_set_active(dev); pm_runtime_enable(dev); @@ -804,6 +804,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) return 0; +err_plat_depopulate: + of_platform_depopulate(dev); + err_phys_power: for (i = 0 ; i < PHY_COUNT ; ++i) phy_power_off(priv->phys[i]); -- 2.34.1