Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nicholas Mc Guire and committed by
Linus Walleij
dbc3c629 7a8689df

+4 -1
+4 -1
drivers/soc/ux500/ux500-soc-id.c
··· 203 203 ux500_setup_id(); 204 204 205 205 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); 206 - if (!soc_dev_attr) 206 + if (!soc_dev_attr) { 207 + of_node_put(backupram); 207 208 return -ENOMEM; 209 + } 208 210 209 211 soc_info_populate(soc_dev_attr, backupram); 212 + of_node_put(backupram); 210 213 211 214 soc_dev = soc_device_register(soc_dev_attr); 212 215 if (IS_ERR(soc_dev)) {