Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1036848rdb; Sun, 7 Jan 2024 00:12:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEn/m4nTnl0ZP9oKyOaQgyiV7xeFnYhlRYWRnqqT9KfOQryKLMSO3LGgL+bYDiL8WsrAQ47 X-Received: by 2002:a05:6402:26d3:b0:553:5874:74b7 with SMTP id x19-20020a05640226d300b00553587474b7mr728340edd.99.1704615161697; Sun, 07 Jan 2024 00:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704615161; cv=none; d=google.com; s=arc-20160816; b=IGzWBbksiGeWfxJYfIsn1I0V1eE4D8uder0E6TS8UO6s+aPe/E6qY/OAYoyl+c69bZ 7Tb9uhBeUUTXYC1/oqD/NxOcFBqXSigoRrITk1er5Iurw2PMdY8ZqoWLNIDLNXMDBsY/ N/dUl0bZjg0PEN9myL4Eo6ZvsqENlLvsmfutxB3+g3QTqmMcuyaOHv9UG69YaKCuMrz/ xMElwIsyIPnMUHRPLbFBSuexShEEfOpHDcd6Ey1pB3i3nd4YLJ8T/BehWxJZ9Hmvvj0v QGmvND2C+FAAASQzL0/orqg5l+hcWWMy8JJqIoXvm8kIrpUVg2xE664cdgIq52AQlctz yCAA== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=LQ4ImjzjK8ZTAlmP+wrgMb7Xtb7eat0Xo8zSIFqCBoY=; fh=VE5ygJ027344UbZ5Bn9UrwxaQujFosy+eQJjlo/MqOU=; b=J22g5fCQ+zJm50v6Kpy5BAElteXBZZhQw77pXsNh4ktbRQDPVJzikMvAjkOrlcq29M izdjC/4www0Eik8kafsw4PaRd6/vxksWQDNO2pwJDle1vADfRs+N2Y38mV6/KfntAa3G eWLss6q9VGTg4iyrFV2MjWYIl5n1mBfUy5cMTaYKX+Myo7MRYRG4ZkjnlJp8rOfTFL1P GdErFKBWNd2f+YxuThWxmHlZISs7BfC8FgcwUpwN/u5m32BMUXzZrjkfF8iJVxOqWKOn Q79bo8923MM1qlTvbb2L9dkjVcwqyQXdYroPJLUpeoIO2mWl49jwLrXXfmg26CAktQya lcjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="Vg/znhKa"; spf=pass (google.com: domain of linux-kernel+bounces-18812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h6-20020a05640250c600b0055762193718si1120178edb.136.2024.01.07.00.12.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 00:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="Vg/znhKa"; spf=pass (google.com: domain of linux-kernel+bounces-18812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6C5591F21B4C for ; Sun, 7 Jan 2024 08:12:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3806412B69; Sun, 7 Jan 2024 08:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="Vg/znhKa" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE30D12B6D for ; Sun, 7 Jan 2024 08:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id MOGZrUCWm9dP0MOGZraHLC; Sun, 07 Jan 2024 09:12:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1704615141; bh=LQ4ImjzjK8ZTAlmP+wrgMb7Xtb7eat0Xo8zSIFqCBoY=; h=From:To:Cc:Subject:Date; b=Vg/znhKaeNOWrDwuXPv738I/Rd4tsXNsB3ybHAJAn6l8HG91aqtwLldsMS0hRsI1p oAlIJ0RAtQTEuavoIU0CR7c7E+FUUAqs1mVBt1a796Ht7OqizuXE+UTKrGT53ksWKC qmjLawYBogHzgJGYEuVGVNVisyMxvujp8vtTrCRqqDUjB6Xg5T3yuoyJYJHsRCcVl3 LOS1VvOOPunuuAZLgbygiLQVHKAX27sNG9/FapW/BqSWzGPnKFske0RmZWBhVwVz2F nHUIYZrl5cPJzgK5BOIm1tBt63CRf+klN3R+35nqVDQ18EDz1O3j7ixB1LvvKMCoHO tM1uqfXx9MzAQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 07 Jan 2024 09:12:21 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , Chen-Yu Tsai Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() Date: Sun, 7 Jan 2024 09:12:17 +0100 Message-Id: <6cd6af61e5a91598068227f1f68cfcfde1507453.1704615011.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 d1239b4b3db7..41bb2d2e2ea7 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.34.1