diff options
author | Huang Zijiang <[email protected]> | 2019-02-14 14:39:07 +0800 |
---|---|---|
committer | Borislav Petkov <[email protected]> | 2019-02-15 12:02:47 +0100 |
commit | 7f736599d632dde93bda79cca54fd5dcfd937e06 (patch) | |
tree | e8d651a46772e1afbc1a83ded17a19f0a8a2078b | |
parent | cbfa482f7e2becbb774dd30117efac48819252f8 (diff) |
EDAC, altera: Add missing of_node_put()
The call to of_parse_phandle() returns a node pointer with refcount
incremented thus it must be explicitly decremented here after the last
usage.
Signed-off-by: Huang Zijiang <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Thor Thayer <[email protected]>
Cc: James Morse <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: linux-edac <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
-rw-r--r-- | drivers/edac/altera_edac.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index c89d82aa2776..98e0bd8d9f50 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1046,14 +1046,17 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask, return -ENODEV; } - if (of_address_to_resource(sysmgr_np, 0, &res)) + if (of_address_to_resource(sysmgr_np, 0, &res)) { + of_node_put(sysmgr_np); return -ENOMEM; + } /* Need physical address for SMCC call */ base = res.start; ecc_mgr_map = regmap_init(NULL, NULL, (void *)base, &s10_sdram_regmap_cfg); + of_node_put(sysmgr_np); } of_node_put(np_eccmgr); if (IS_ERR(ecc_mgr_map)) { |