summaryrefslogtreecommitdiffstats
path: root/drivers/soc/ux500
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2019-04-13 09:14:21 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-07-23 09:49:32 +0200
commitdbc3c6295195267ea7bc48d46030c7b244f8b11e (patch)
tree19139f498d297c8c7b03619cac0d0e7a4f4d6483 /drivers/soc/ux500
parentARM: ux500: Stop populating the PRCMU devices early (diff)
downloadlinux-dbc3c6295195267ea7bc48d46030c7b244f8b11e.tar.xz
linux-dbc3c6295195267ea7bc48d46030c7b244f8b11e.zip
ARM: ux500: add missing of_node_put()
of_find_compatible_node() returns a pointer with refcount incremented so both in the error path as well as after usage in soc_info_populate() respectively actually b8500_read_soc_id() an explicit of_node_put is needed to release backupram. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Fixes: commit 18a992787896 ("ARM: ux500: move soc_id driver to drivers/soc") Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/soc/ux500')
-rw-r--r--drivers/soc/ux500/ux500-soc-id.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c
index ea5fd2e5e340..d64feeb51a40 100644
--- a/drivers/soc/ux500/ux500-soc-id.c
+++ b/drivers/soc/ux500/ux500-soc-id.c
@@ -203,10 +203,13 @@ static int __init ux500_soc_device_init(void)
ux500_setup_id();
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
- if (!soc_dev_attr)
+ if (!soc_dev_attr) {
+ of_node_put(backupram);
return -ENOMEM;
+ }
soc_info_populate(soc_dev_attr, backupram);
+ of_node_put(backupram);
soc_dev = soc_device_register(soc_dev_attr);
if (IS_ERR(soc_dev)) {