]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ARM: exynos: Fix a leaked reference by adding missing of_node_put
authorWen Yang <wen.yang99@zte.com.cn>
Tue, 5 Mar 2019 11:33:54 +0000 (19:33 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit2bba037f4cabb75f3b4e2c24f6f5deb56c3f8608
tree500a3cbfdeaa52685499ec8599458645403aefe3
parent1d05f8a06af98f5082cf81bb8aac7f1b187a9b9f
ARM: exynos: Fix a leaked reference by adding missing of_node_put

BugLink: https://bugs.launchpad.net/bugs/1838576
commit 629266bf7229cd6a550075f5961f95607b823b59 upstream.

The call to of_get_next_child returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with warnings like:
    arch/arm/mach-exynos/firmware.c:201:2-8: ERROR: missing of_node_put;
        acquired a node pointer with refcount incremented on line 193,
        but without a corresponding object release within this function.

Cc: stable@vger.kernel.org
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm/mach-exynos/firmware.c
arch/arm/mach-exynos/suspend.c