Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2391961lqp; Sun, 24 Mar 2024 17:25:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFUKVWfkZ/HzvIAvKWD2r0WuU/0bFDjTnTk9I7Othzrj4npuTzxu0GkSUrewa+wECrPkdghsNoHz8cz1bVs+EWm9U1bLZVhHpNR6023g== X-Google-Smtp-Source: AGHT+IFxJHQd3SgGyxZ9I94hqt65jVX5cfTCkp9PMq26nzgNk/uTctwUbg6hgQfz0xmNbrao2HCD X-Received: by 2002:a17:90a:ae0f:b0:29b:bcea:c17e with SMTP id t15-20020a17090aae0f00b0029bbceac17emr3489874pjq.1.1711326300867; Sun, 24 Mar 2024 17:25:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711326300; cv=pass; d=google.com; s=arc-20160816; b=KhbcQNRy3KjpE+/syZz1vqZyIBu3E/AnwR5YTnG4LedsxZ9/Z2XiMgBA6qFh1pKYsA jKLZSHMn1EK6FrWckqvwk0vfwA7eyecwA5fPZO7YydcIOh5B8sr9OyhFDpeaTzvGXNVc TyJL7C69p5bje/zflW+f/iDnDAGB9uBAKS08mJVhi3swOjrLdc136WMUtGsiZ+iVuUUA JC6ObZ3AfOjWlplBon0jAl4fdajxcAHOAvePprENbviNSTm5ATCNKeKQrUgrnANYke4e vNEoODqqis4fYw2cfYps5CB8f9dQb0yfc5CBEnh2HsZAZy+y7oGwx22876muxFp5LsBX OUgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+E01JBS8GcNVQz7gKM9GvVWNLKMYx6pGPY02DloQtJI=; fh=PkZPX8LGtk6tnJM2YeFswSw+2gGR2ws/MDmTdq0lHDs=; b=i8SYKVcQTnU18mkKjAtanWfwPO0ewCig4escaR+E0Wty5WzP3+kN/riCXQPAfP0daJ wOh7dilfSHOIpfyAUCqK+nFbj38rFxneW82ElFnw9pUDq0QvPsSelf7UpThmTb1hXrzP EWVW3SrotplD2etok11E7dGM8Au621+krUOSC0v2saTpjm4nQpHNzKMXNr9f4b8/HqBP y/JZW8i60B6u/0IaGmG8iRfkt1lBQNYd/0oNofNxzWnjku4tgrkl5uZ/8iDrr37u69ue /pYZW+zUgtTBUEXHbzvx0+Sz80UtXeESPsHhKAEKeIXfSM4d0w64vcw/zD/k/5qm4nkV emDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qJD9uXbz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d3-20020a17090ad3c300b0029fc4a56910si10179480pjw.46.2024.03.24.17.25.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qJD9uXbz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A7482B23F63 for ; Mon, 25 Mar 2024 00:14:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F8B8199257; Sun, 24 Mar 2024 22:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qJD9uXbz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E7EB199236; Sun, 24 Mar 2024 22:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320146; cv=none; b=VfkN9tgPMFc51+H8i7SBwrOgT+ktGGq4GEP/hX5HyXxw8+7cVLS8L4f3+dEW+kkYUqgV2/8HJYBqJrLUiCQOQnjYijzqs3IptDEcNDJ/P5wtwzO+ANWLvDbG+nmrB0rBTimLl7v9KObC+9h/3HDsjzOuI86qHUmwTyiY3VvtZCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320146; c=relaxed/simple; bh=I0ftkpg1auOYnQ2mH1Az1FoRNSu97/FiJb83KHbPwCQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O+Sg+rWCHKn5R816ka2Aebv4BBECeiatKyuge0xt+P63JhyhGbgMUZI5tcZouW8aj5D+Gc+H6o6fFeXiLk4MsJnGU5vTu1cw0SIUiKuGtNPJZDJiRnRpSqaMntKpH0og3WZfiMIafo6ebJ0c0ij5Qh4HZBfNEg7igmDtzOucupE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qJD9uXbz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4726EC43390; Sun, 24 Mar 2024 22:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320146; bh=I0ftkpg1auOYnQ2mH1Az1FoRNSu97/FiJb83KHbPwCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJD9uXbzSgqdjO1V0ci6da98g+y8hgssqRoEqDk3yheIkPrFvzBO2GxjTAiuCpPip Hy+iITQL3yTMysU2pzuDrX2AUOPUog/ArNZcjcGVqKt01dBAFs2bMU/6zQUUVgb0sm tFQ/OnTvRA4xwoX02rKP0NvZU3zqETcgVajbpPLqI2bxI8sDGV6yp2ZE2VHpn3jAZB JQ3PMauPsvXbfCgB1MRra6QRjPRw6Vi1MjVbHP+Zt/UzMjZrSx8nOTNuE35AxW5nwX OWZg54Wdrpfv4fJzpIUG75OVUlR3lYsJC/gisjLzYFus2RMt8bPCUDSUqKzN+LZd2p +gw5HNEV3tYAg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , AngeloGioacchino Del Regno , Stephen Boyd , Sasha Levin Subject: [PATCH 6.8 454/715] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() Date: Sun, 24 Mar 2024 18:30:33 -0400 Message-ID: <20240324223455.1342824-455-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christophe JAILLET [ Upstream commit 03c1c51eba6be49b42816af9db114553131af6c8 ] If an error occurs after mtk_alloc_clk_data(), mtk_free_clk_data() should be called, as already done in the remove function. Fixes: 54b7026f011e ("clk: mediatek: mt8135-apmixedsys: Convert to platform_driver and module") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/6cd6af61e5a91598068227f1f68cfcfde1507453.1704615011.git.christophe.jaillet@wanadoo.fr Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c index d1239b4b3db74..41bb2d2e2ea74 100644 --- a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c @@ -59,7 +59,7 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); if (ret) - return ret; + goto free_clk_data; ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); if (ret) @@ -69,6 +69,8 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) unregister_plls: mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); +free_clk_data: + mtk_free_clk_data(clk_data); return ret; } -- 2.43.0