From patchwork Sat Dec 17 16:05:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 34215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1593791wrn; Sat, 17 Dec 2022 08:51:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf6AQzS3BT6hYHd+6Yw/14Ys10+bTYhwqajdHRFqO/NkOTvlG1ZnSUhZ3dFPwQ4nIUMmfZjE X-Received: by 2002:a17:907:1256:b0:7c1:1adc:46fd with SMTP id wc22-20020a170907125600b007c11adc46fdmr25362958ejb.34.1671295884747; Sat, 17 Dec 2022 08:51:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671295884; cv=none; d=google.com; s=arc-20160816; b=NgUAOBetimZzzyO7FBuD1HP/JZ09Np5W41Dahu93aBtaEUwxZRyF8mqQd7tmBtxcXE +g2Xvag74HGxRLqxtzm2g4nNKwOwkXAuq1Lk4L9UwIyQVFDUXZ5tktZSto4pvNBX8qWp V6QyxpHO1OdMPFnJcjvQdrkolrCw6kYpxVGqD+KVF8F0DjwbfVhe440bobVrgt9hXxLT yPKWW4g8IkkA3LAjXPECuO83Uje1X9bholON2c4RMSrbugrRZTCeOR6Sw4mJdcjx6Y58 cO0suliWn13kwbGUG16TfrWQV1j+74R0Ap9uBMoB4fB4bBOQAL1kAGnMEfAWCFfMJyxO JkDA== 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; bh=zCScvqZt3QAF2gdABvoFDsYeEiKrMyJxq/9dfzt2D+s=; b=oVkDYGvQEToiqih+AmwGewVkGTDHki6qLqvL1jfikOLSZRe/hVGkCRcnFhriKlFrd6 giELBDTlqEknJ4qKgmf0XwSpnZtcSmxtyLuxBY36GNZftHXtTrLGF6XIoICcyMAuycYj J3o5f5bjFuZMDSjoDcQ4WnBhymCHFgoS5R0H0AoZrhV0qBOCvB3RhYT0wiICM2ag13+J DjxMVITzutOB3r/IrrQ8OzB4M7Cb4rdONG2GVrMc8H6e9vny9g9G/LX7uZWsUBB8f1nW ZxJF4hOhN+o/1ZfVZYc0ohfA42/WUL4geO9FlUq1kNLRRgW1+9Z895zUX0NYzrfaQIqG 6xRg== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc24-20020a1709071c1800b0078de536a3cdsi6078443ejc.119.2022.12.17.08.51.01; Sat, 17 Dec 2022 08:51:24 -0800 (PST) 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; 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 S229613AbiLQQFz (ORCPT + 99 others); Sat, 17 Dec 2022 11:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiLQQFv (ORCPT ); Sat, 17 Dec 2022 11:05:51 -0500 Received: from smtp.smtpout.orange.fr (smtp-12.smtpout.orange.fr [80.12.242.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26EB8F62 for ; Sat, 17 Dec 2022 08:05:47 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 6Zh1p8BhCoBUE6Zh1pSnSL; Sat, 17 Dec 2022 17:05:44 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 17 Dec 2022 17:05:44 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Niklas Cassel , Andy Gross , Bjorn Andersson , Konrad Dybcio , Jorge Ramirez-Ortiz , Ulf Hansson , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Niklas Cassel , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() Date: Sat, 17 Dec 2022 17:05:41 +0100 Message-Id: <0f520597dbad89ab99c217c8986912fa53eaf5f9.1671293108.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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?1752480753323422945?= X-GMAIL-MSGID: =?utf-8?q?1752480753323422945?= If an error occurs after a successful pm_genpd_init() call, it should be undone by a corresponding pm_genpd_remove(). Add the missing call in the error handling path, as already done in the remove function. Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)") Signed-off-by: Christophe JAILLET Reviewed-by: Ulf Hansson --- drivers/soc/qcom/cpr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/cpr.c b/drivers/soc/qcom/cpr.c index e9b854ed1bdf..144ea68e0920 100644 --- a/drivers/soc/qcom/cpr.c +++ b/drivers/soc/qcom/cpr.c @@ -1708,12 +1708,16 @@ static int cpr_probe(struct platform_device *pdev) ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd); if (ret) - return ret; + goto err_remove_genpd; platform_set_drvdata(pdev, drv); cpr_debugfs_init(drv); return 0; + +err_remove_genpd: + pm_genpd_remove(&drv->pd); + return ret; } static int cpr_remove(struct platform_device *pdev)