summaryrefslogtreecommitdiffstats
path: root/drivers/soc/bcm
diff options
context:
space:
mode:
authorWan Jiabing <wanjiabing@vivo.com>2021-10-15 08:49:23 +0200
committerFlorian Fainelli <f.fainelli@gmail.com>2021-11-15 18:57:14 +0100
commitf5029f62d9ba9b99fd712514784f91f920a63d21 (patch)
tree37cf12868fc45e32ba6776adc538e7c4711ccdc5 /drivers/soc/bcm
parentLinux 5.16-rc1 (diff)
downloadlinux-f5029f62d9ba9b99fd712514784f91f920a63d21.tar.xz
linux-f5029f62d9ba9b99fd712514784f91f920a63d21.zip
soc: bcm: brcmstb: Add of_node_put() in pm-mips
Fix following coccicheck warning: ./drivers/soc/bcm/brcmstb/pm/pm-mips.c:404:1-23: WARNING: Function for_each_matching_node should have of_node_put() before goto or break Early exits from for_each_matching_node should decrement the node reference counter. Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'drivers/soc/bcm')
-rw-r--r--drivers/soc/bcm/brcmstb/pm/pm-mips.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/soc/bcm/brcmstb/pm/pm-mips.c b/drivers/soc/bcm/brcmstb/pm/pm-mips.c
index cdc3e387f049..4dfb5a85032b 100644
--- a/drivers/soc/bcm/brcmstb/pm/pm-mips.c
+++ b/drivers/soc/bcm/brcmstb/pm/pm-mips.c
@@ -405,11 +405,14 @@ static int brcmstb_pm_init(void)
i = ctrl.num_memc;
if (i >= MAX_NUM_MEMC) {
pr_warn("Too many MEMCs (max %d)\n", MAX_NUM_MEMC);
+ of_node_put(dn);
break;
}
base = brcmstb_ioremap_node(dn, 0);
- if (IS_ERR(base))
+ if (IS_ERR(base)) {
+ of_node_put(dn);
goto ddr_err;
+ }
ctrl.memcs[i].ddr_phy_base = base;
ctrl.num_memc++;