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++;