Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6942745rwr; Tue, 25 Apr 2023 06:12:35 -0700 (PDT) X-Google-Smtp-Source: AKy350aZFy3CfcXi43Jq2kjh20mV/lqFDrmCIbJH2vWmw/FzPFblMN6GjlnTghSM/QDEk2yb5vFi X-Received: by 2002:a05:6a00:1acd:b0:635:7fb2:2ab4 with SMTP id f13-20020a056a001acd00b006357fb22ab4mr19664548pfv.6.1682428355094; Tue, 25 Apr 2023 06:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682428355; cv=none; d=google.com; s=arc-20160816; b=q7C8xb0jX9SclfmmGRgpc0xdrDaq0Ifwj1Wfai5dUDIX6n9Zudt2qQUzBbdnL+SwIn wClwaTLh5AIswf2Q4X5EqR9DmV5KM/9oeI3C6skcH1EgQoVpSPwGrA34XmoYAe1bCwXz AZ3xO/3cwX3nQUwS4oF9hW6RYxoPFpmdnp7TLvmovMheTRgL4dSG7FYPPOzZoUMmykK+ NBC4AQpF9++fY6IBjWGwOkOW7jPyYSjzgk/GyeUg4Xy57LpfrYzFRrLDkae7w+vODbpO ZflnCGNPT5tMprWSqAU6yLiK2YOBrjYCjAnu7sA4EcoUBLn8JuwH7078l/Wf7iCSBO7r zVlw== 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=WXiKOTUweT4dQBcURtN4IPuxsbpAL9eY85lFUMFtYlY=; b=EUpFDLJkRMSyQbMf3b/9d0tr6Ong1nFeT+eiCSXnehzH++OymcsxznI8y2ySV9rjFf 7M2IRyZW8thDOPy6xpgSX4LKRE/xO0W0c50B04TSDZMT9Q/agGyFk+hawGjxBW3IK1Ld d8IwySSOn8YcvAJZWw9EGrWkbxgzwAxFA4DFNx1uNonIlCd6vsM3Nqpxr96t4gD8x7yd dNPpQf2dnqWWyRsoW7ZFdxIhwO1hfjBjbgO9lD8uFtHziYaBeNMfP7zyb84G8ZciGfOD gz+TsgeDKUu4jBxh6MsFhoKx3zhD2kyLmlLemGM/d49kK+t+tRSblJHvx9nt4D+BT8qB 3n5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=hbpLJFvC; 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 b188-20020a621bc5000000b0063b870bc579si978981pfb.349.2023.04.25.06.12.13; Tue, 25 Apr 2023 06:12:35 -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=hbpLJFvC; 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 S229490AbjDYNL1 (ORCPT + 99 others); Tue, 25 Apr 2023 09:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbjDYNL0 (ORCPT ); Tue, 25 Apr 2023 09:11:26 -0400 Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA7CA249 for ; Tue, 25 Apr 2023 06:11:24 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id rIS0pfcRMLf5zrIS0p4TSz; Tue, 25 Apr 2023 15:11:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1682428281; bh=WXiKOTUweT4dQBcURtN4IPuxsbpAL9eY85lFUMFtYlY=; h=From:To:Cc:Subject:Date; b=hbpLJFvCsemS0Uu45T4qTVqdi6a3ZqQQ+8kgeY1JgGuAqYlNDAdj6kEkBbXH2Sn1E CbPD7bQGrDkA8WZ8qXAHkNi5BxTR9wy167CR12PDQlv/IZICEwocqLw2dhHjwiYFBL wphRORSM/lG3G8wQ9Vn23Zxi8AOvB84be+HoU/Q2xfwZiBRmpsKiYMb3FMkFyrNp5I 2QzSqucKwZgi+TWyd5J6f0cITlGWj5pCuOFgy3LWA98ADXpBw+xWoQtQwLpuiRdZQv o6xowQaW5SnjZJby0ENTYyye77DpXRGCR9VgZlvVVOnxNpJmrJWZiCO/sZkLCNhl+b C2lrLVzZ0Au+Q== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 25 Apr 2023 15:11:21 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter , Sumit Gupta Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH] cpufreq: tegra194: Fix an error handling path in tegra194_cpufreq_probe() Date: Tue, 25 Apr 2023 15:11:19 +0200 Message-Id: <30b17e2219abc3a9a137d28bb51e53732bba5103.1682428267.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_H2,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 the probe needs to be deferred, some resources still need to be released. So branch to the error handling path instead of returning directly. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/cpufreq/tegra194-cpufreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c index c8d03346068a..36dad5ea5947 100644 --- a/drivers/cpufreq/tegra194-cpufreq.c +++ b/drivers/cpufreq/tegra194-cpufreq.c @@ -686,8 +686,10 @@ static int tegra194_cpufreq_probe(struct platform_device *pdev) /* Check for optional OPPv2 and interconnect paths on CPU0 to enable ICC scaling */ cpu_dev = get_cpu_device(0); - if (!cpu_dev) - return -EPROBE_DEFER; + if (!cpu_dev) { + err = -EPROBE_DEFER; + goto err_free_res; + } if (dev_pm_opp_of_get_opp_desc_node(cpu_dev)) { err = dev_pm_opp_of_find_icc_paths(cpu_dev, NULL); -- 2.34.1