Skip to contentSkip to conversation

memory: emif: add missing of_node_put after calling of_parse_phandle

PATCH Superseded Peter Chen 2 participants 2 messages Jul 15, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH 1/1 memory: emif: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.

---
 drivers/memory/emif.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/memory/emif.c +2 -0
index 04644e7..c5ec77d 100644
@@ -1409,8 +1409,10 @@ static struct emif_data * __init_or_module of_get_memory_device_details(
 	goto out;
 
 error:
+	of_put_node(np_ddr);
 	return NULL;
 out:
+	of_put_node(np_ddr);
 	return emif;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
url: https://github.com/0day-ci/linux/commits/Peter-Chen/memory-emif-add-missing-of_node_put-after-calling-of_parse_phandle/20160715-190829 config: arm-omap2plus_defconfig (attached as .config)…

Hi,

[auto build test ERROR on v4.7-rc7]
[also build test ERROR on next-20160715]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Peter-Chen/memory-emif-add-missing-of_node_put-after-calling-of_parse_phandle/20160715-190829
config: arm-omap2plus_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

drivers/memory/emif.c: In function 'of_get_memory_device_details':

>> drivers/memory/emif.c:1412:2: error: implicit declaration of function 'of_put_node' [-Werror=implicit-function-declaration]
     of_put_node(np_ddr);
     ^

cc1: some warnings being treated as errors

vim +/of_put_node +1412 drivers/memory/emif.c

1406 &emif->plat_data->timings_arr_size);
1407
1408 emif->plat_data->min_tck = of_get_min_tck(np_ddr, emif->dev);
1409 goto out;
1410
1411 error:

> 1412		of_put_node(np_ddr);

1413 return NULL;
1414 out:
1415 of_put_node(np_ddr);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation