]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: tegra: do not overallocate memory for bpmp clocks
authorFedor Pchelkin <pchelkin@ispras.ru>
Sat, 26 Apr 2025 12:54:28 +0000 (15:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:23:07 +0000 (16:23 +0200)
commit635c125cdccc4edb1fce2560caed6e7496218c01
tree6f198eb1d05cfa514b54574df70add7ba2110003
parent5cb1c7600e333eb91b1749e5b7332a823104ba04
clk: tegra: do not overallocate memory for bpmp clocks

[ Upstream commit 49ef6491106209c595476fc122c3922dfd03253f ]

struct tegra_bpmp::clocks is a pointer to a dynamically allocated array
of pointers to 'struct tegra_bpmp_clk'.

But the size of the allocated area is calculated like it is an array
containing actual 'struct tegra_bpmp_clk' objects - it's not true, there
are just pointers.

Found by Linux Verification Center (linuxtesting.org) with Svace static
analysis tool.

Fixes: 2db12b15c6f3 ("clk: tegra: Register clocks from root to leaf")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/tegra/clk-bpmp.c