aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-bcm/board_bcm281xx.c
diff options
context:
space:
mode:
authorWen Yang <wen.yang99@zte.com.cn>2019-03-05 19:33:53 +0800
committerFlorian Fainelli <f.fainelli@gmail.com>2019-05-20 09:34:26 -0700
commit8abc5a7ce6e6a5b77f0ec82c91107a978b32f6e3 (patch)
tree4678d6f22182fef66ab705d490e7fa3550feb75c /arch/arm/mach-bcm/board_bcm281xx.c
parentLinux 5.2-rc1 (diff)
downloadlinux-dev-8abc5a7ce6e6a5b77f0ec82c91107a978b32f6e3.tar.xz
linux-dev-8abc5a7ce6e6a5b77f0ec82c91107a978b32f6e3.zip
ARM: bcm: fix a leaked reference by adding missing of_node_put
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 the following warnings: ./arch/arm/mach-bcm/board_bcm281xx.c:43:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 35, but without a corresponding object release within this function. ./arch/arm/mach-bcm/platsmp-brcmstb.c:337:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 329, but without a corresponding object release within this function. ./arch/arm/mach-bcm/platsmp-brcmstb.c:341:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 329, but without a corresponding object release within this functio ./arch/arm/mach-bcm/bcm63xx_smp.c:150:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 130, but without a corresponding object release within this function. Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: Russell King <linux@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Brian Norris <computersforpeace@gmail.com> Cc: Gregory Fong <gregory.0xf0@gmail.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'arch/arm/mach-bcm/board_bcm281xx.c')
-rw-r--r--arch/arm/mach-bcm/board_bcm281xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c
index b81bb386951d..1238ac801530 100644
--- a/arch/arm/mach-bcm/board_bcm281xx.c
+++ b/arch/arm/mach-bcm/board_bcm281xx.c
@@ -38,6 +38,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
return;
}
base = of_iomap(np_wdog, 0);
+ of_node_put(np_wdog);
if (!base) {
pr_emerg("Couldn't map brcm,kona-wdt\n");
return;