]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
openrisc: Fix a memory leak
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 23 Apr 2021 15:09:28 +0000 (17:09 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:26:52 +0000 (08:26 +0200)
commitf6ed2cbe8d1f470d872153c34a96f07f3e5d1d22
tree34bae58902c577721e1a2535dc4e8789577f0e75
parenteea9069ccc10ff6516a46431e711569c1cd233c7
openrisc: Fix a memory leak

BugLink: https://bugs.launchpad.net/bugs/1931896
[ Upstream commit c019d92457826bb7b2091c86f36adb5de08405f9 ]

'setup_find_cpu_node()' take a reference on the node it returns.
This reference must be decremented when not needed anymore, or there will
be a leak.

Add the missing 'of_node_put(cpu)'.

Note that 'setup_cpuinfo()' that also calls this function already has a
correct 'of_node_put(cpu)' at its end.

Fixes: 9d02a4283e9c ("OpenRISC: Boot code")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/openrisc/kernel/setup.c