[v2,1/5] clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains()
Message ID | ced98eb9416ded902f3896ba58fee72991864e26.1694722339.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp741419vqi; Thu, 14 Sep 2023 18:44:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENqbGRag+45Ivp4oAFlv7qqVva8G+IiTgOi5MjCVRJ3S/5E3S9Nq6xeupL4/fdSnu6Rbg5 X-Received: by 2002:a05:620a:2589:b0:767:82e8:eb88 with SMTP id x9-20020a05620a258900b0076782e8eb88mr244821qko.7.1694742277182; Thu, 14 Sep 2023 18:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694742277; cv=none; d=google.com; s=arc-20160816; b=bGeJfaSmEV7TGoZyPDRNQEQTsvDi5BkqWWVrB6GfTizPOtyWK88eUiWZzm06a8eVsF cx8qkO/BQaU1WXAqLZF+FpFnDcKtaOlBqsKaVxKWSUlu0p6nc33xq+9wkS2JeF8dRfbY +v4+XFixCXRPLBG4EUFn0+4PiJY5YDcY5KL//LZwr6B/8Q3q5HTQdfzA82LHkWy/ZwrN U6eQkH7xtHT7Hvx8fTDyuPljNHvlDKsOFAIKVshjCYz5cvJiBVV1pjXR7Bsnc7sl+Rac G4scAd2RYOIKbHdLY4kF1XpzDYWM2DmopdM+BBRPz9mK76aBYGfXap+ENOa2KmQFzM/k XuMA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vDMwGPoL7IUwKLZSj66ABJwQcRH7iJ6OhehhdBpzoGI=; fh=uRtjX4tW/2u6hJ6MjD3hufbLT/8nXPchx+f+WmII/I4=; b=g2xZPsQYYOxLO3v+u8LR58hvc//1cm7i/PsGYK3Bg5+N1y/PBGepfj7D918NLxdSWB 6MAadDlD4dryu/Mx8o824bGiACBtVV9j0105isl46JlKcMv8nMJ8pBGR9vJi5VUFTK20 Uszn4J6MSjLzpOdPAEvPGYKvG9G4tctuOWPDsnnO9CZZ6LjR2JoLoGbjlKwkjzl1q8oc NYrP9xwuh8Z1dHLtlcydaNsH1oaeRHZh3DmjG2CFowuQE6P8INTXYIRH53YIeMD5bHCC tJYrrT63qqFSh+YhqfsNyyPhBioWtx6IVZ0IxWWVdS51YArFNGKId7XxrYH8NC05lJAD F7YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=H53P1VIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x5-20020a654145000000b00564a1716ebbsi2286644pgp.697.2023.09.14.18.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 18:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=H53P1VIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 28B10819FC48; Thu, 14 Sep 2023 13:31:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbjINUb0 (ORCPT <rfc822;pwkd43@gmail.com> + 33 others); Thu, 14 Sep 2023 16:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbjINUbY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 16:31:24 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19ABF2704 for <linux-kernel@vger.kernel.org>; Thu, 14 Sep 2023 13:31:20 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszeqSuie; Thu, 14 Sep 2023 22:31:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723478; bh=vDMwGPoL7IUwKLZSj66ABJwQcRH7iJ6OhehhdBpzoGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H53P1VIqYoTjl1GsFVQAtp1OUqAcTgfxyzCQIi7cOILeyUZmPhDyWJhgyBfbLcBp1 Ytg/siSE+/4EFWOce4lK2PyDFezrBpi2Y403yLVvLp1XBhT+9W2cr+jitk4DWtiqml Ww737IvD6ByWQupws/gWtCOkh4TqrHIWKsP+0Yp0qBJHd624z/ESKvMjFwkE29XY6i IIEO6CUPSk2FdJXq0YBaIWrD6i2/Z9VlX7nqZo8qrrR6ojDVItnZ7K2DAR//iSheYo MY7ePLJMSK5fxMknV83WAokoDP6yHtaUeQAp58i3pkBi3talLLPHzitWCMYxN3G23u esTHVNSH3ybLw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31:18 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH v2 1/5] clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() Date: Thu, 14 Sep 2023 22:31:02 +0200 Message-Id: <ced98eb9416ded902f3896ba58fee72991864e26.1694722339.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1694722339.git.christophe.jaillet@wanadoo.fr> References: <cover.1694722339.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 13:31:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777066078092616408 X-GMAIL-MSGID: 1777066078092616408 |
Series |
clk: imx: imx8: Fix some error handling paths
|
|
Commit Message
Christophe JAILLET
Sept. 14, 2023, 8:31 p.m. UTC
If a dev_pm_domain_attach_by_id() call fails, previously allocated resources need to be released. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/clk/imx/clk-imx8-acm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 1e82f72b75c6..87025a6772d0 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -279,8 +279,10 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev, for (i = 0; i < dev_pm->num_domains; i++) { dev_pm->pd_dev[i] = dev_pm_domain_attach_by_id(dev, i); - if (IS_ERR(dev_pm->pd_dev[i])) - return PTR_ERR(dev_pm->pd_dev[i]); + if (IS_ERR(dev_pm->pd_dev[i])) { + ret = PTR_ERR(dev_pm->pd_dev[i]); + goto detach_pm; + } dev_pm->pd_dev_link[i] = device_link_add(dev, dev_pm->pd_dev[i],