From mboxrd@z Thu Jan 1 00:00:00 1970 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 BCCF71A76A5; Mon, 14 Oct 2024 14:25:04 +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=1728915904; cv=none; b=RUGYU3E/XfuFLNEeWSq4dJgvl8MvKc+gDNaOQZsuAseJzrTiMLhijvp/vvjR6uBoaAvGLp6k7XSkrE1qVrD2M4/8/TlR/ugGiskf69joY/AU0gEkaoHeW8qdKdaZJOyhcRr0huy0/0OhR06Dgm/oueBjPDDGT+pb19oH2Ql2Qwc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728915904; c=relaxed/simple; bh=K2SZt8pEjXxdzmWZ9CSacheGqkmkNLjivwpEBPnwXt4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M2W4CpnGxbY49Z+UGhRvQb33WcRjN3chGL/kzzTsXxX9TeUiXzqFChYqcjdDqcWHNBJ+6TVrXyAKdcr4/1SknW02heHpZ5TIcKlRemC86X1q6N+o4NojFHZDcGlIcxhShWekVfv1LProVByv4gx56qMS8JTrWyU4bUFqglIlFg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zxQP77il; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zxQP77il" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31DC3C4CEC3; Mon, 14 Oct 2024 14:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728915904; bh=K2SZt8pEjXxdzmWZ9CSacheGqkmkNLjivwpEBPnwXt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zxQP77ilTHWV65SyTKLS4fsLUmBYad/UjOnbuz9Vq9KIdD1lcfgTMXer17n+W3ME2 1OQQEuD+OotK/6KyQOfDrrhO2buDOgIPgG1StiALDtAK03NVfzA4CYNqhRmJWQrws6 PaSR5XLpCdOXAPagvRcMribOLfj6ujQ2fS8edpfw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Krzysztof Kozlowski , Stephen Boyd , Sasha Levin Subject: [PATCH 6.11 033/214] clk: bcm: bcm53573: fix OF node leak in init Date: Mon, 14 Oct 2024 16:18:16 +0200 Message-ID: <20241014141046.280631941@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141044.974962104@linuxfoundation.org> References: <20241014141044.974962104@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski [ Upstream commit f92d67e23b8caa81f6322a2bad1d633b00ca000e ] Driver code is leaking OF node reference from of_get_parent() in bcm53573_ilp_init(). Usage of of_get_parent() is not needed in the first place, because the parent node will not be freed while we are processing given node (triggered by CLK_OF_DECLARE()). Thus fix the leak by accessing parent directly, instead of of_get_parent(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20240826065801.17081-1-krzysztof.kozlowski@linaro.org Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/bcm/clk-bcm53573-ilp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-bcm53573-ilp.c b/drivers/clk/bcm/clk-bcm53573-ilp.c index 84f2af736ee8a..83ef41d618be3 100644 --- a/drivers/clk/bcm/clk-bcm53573-ilp.c +++ b/drivers/clk/bcm/clk-bcm53573-ilp.c @@ -112,7 +112,7 @@ static void bcm53573_ilp_init(struct device_node *np) goto err_free_ilp; } - ilp->regmap = syscon_node_to_regmap(of_get_parent(np)); + ilp->regmap = syscon_node_to_regmap(np->parent); if (IS_ERR(ilp->regmap)) { err = PTR_ERR(ilp->regmap); goto err_free_ilp; -- 2.43.0