diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-07-24 13:54:12 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-07 18:59:26 +0200 |
commit | 503aae8dcc18da16db4e5560188ac2a6162800d0 (patch) | |
tree | e4c26d5352ccfe9364ff6a532b0c64186dd4d705 /include/net/ife.h | |
parent | b0a68c63887547fd190faa87c2c398b362b304f7 (diff) | |
download | linux-stable-503aae8dcc18da16db4e5560188ac2a6162800d0.tar.gz linux-stable-503aae8dcc18da16db4e5560188ac2a6162800d0.tar.bz2 linux-stable-503aae8dcc18da16db4e5560188ac2a6162800d0.zip |
PCI: tegra: Fix OF node reference leak
[ Upstream commit 9e38e690ace3e7a22a81fc02652fc101efb340cf ]
Each iteration of for_each_child_of_node() executes of_node_put() on the
previous node, but in some return paths in the middle of the loop
of_node_put() is missing thus causing a reference leak.
Hence stash these mid-loop return values in a variable 'err' and add a
new label err_node_put which executes of_node_put() on the previous node
and returns 'err' on failure.
Change mid-loop return statements to point to jump to this label to
fix the reference leak.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
[lorenzo.pieralisi@arm.com: rewrote commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/net/ife.h')
0 files changed, 0 insertions, 0 deletions