Re: [PATCH] of: Add missing of_node_put() before return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20220421]
[cannot apply to robh/for-next v5.18-rc3 v5.18-rc2 v5.18-rc1 v5.18-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Wan-Jiabing/of-Add-missing-of_node_put-before-return/20220421-202418
base:    65eb92e4c9f0a962656f131521f4fbc0d24c9d4c
config: hexagon-randconfig-r045-20220421 (https://download.01.org/0day-ci/archive/20220422/202204220341.c0TfAOVa-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project bac6cd5bf85669e3376610cfc4c4f9ca015e7b9b)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/e54621b530fe295566dfa8bc3d3481e624c3ee01
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Wan-Jiabing/of-Add-missing-of_node_put-before-return/20220421-202418
        git checkout e54621b530fe295566dfa8bc3d3481e624c3ee01
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/of/platform.c:560:22: error: expected ';' after expression
                                   of_node_put(node)
                                                    ^
                                                    ;
   1 error generated.


vim +560 drivers/of/platform.c

   515	
   516	static int __init of_platform_default_populate_init(void)
   517	{
   518		struct device_node *node;
   519	
   520		device_links_supplier_sync_state_pause();
   521	
   522		if (!of_have_populated_dt())
   523			return -ENODEV;
   524	
   525		if (IS_ENABLED(CONFIG_PPC)) {
   526			struct device_node *boot_display = NULL;
   527			struct platform_device *dev;
   528			int ret;
   529	
   530			/* Check if we have a MacOS display without a node spec */
   531			if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL)) {
   532				/*
   533				 * The old code tried to work out which node was the MacOS
   534				 * display based on the address. I'm dropping that since the
   535				 * lack of a node spec only happens with old BootX versions
   536				 * (users can update) and with this code, they'll still get
   537				 * a display (just not the palette hacks).
   538				 */
   539				dev = platform_device_alloc("bootx-noscreen", 0);
   540				if (WARN_ON(!dev))
   541					return -ENOMEM;
   542				ret = platform_device_add(dev);
   543				if (WARN_ON(ret)) {
   544					platform_device_put(dev);
   545					return ret;
   546				}
   547			}
   548	
   549			/*
   550			 * For OF framebuffers, first create the device for the boot display,
   551			 * then for the other framebuffers. Only fail for the boot display;
   552			 * ignore errors for the rest.
   553			 */
   554			for_each_node_by_type(node, "display") {
   555				if (!of_get_property(node, "linux,opened", NULL) ||
   556				    !of_get_property(node, "linux,boot-display", NULL))
   557					continue;
   558				dev = of_platform_device_create(node, "of-display", NULL);
   559				if (WARN_ON(!dev)) {
 > 560					of_node_put(node)
   561					return -ENOMEM;
   562				}
   563				boot_display = node;
   564				break;
   565			}
   566			for_each_node_by_type(node, "display") {
   567				if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
   568					continue;
   569				of_platform_device_create(node, "of-display", NULL);
   570			}
   571	
   572		} else {
   573			/*
   574			 * Handle certain compatibles explicitly, since we don't want to create
   575			 * platform_devices for every node in /reserved-memory with a
   576			 * "compatible",
   577			 */
   578			for_each_matching_node(node, reserved_mem_matches)
   579				of_platform_device_create(node, NULL, NULL);
   580	
   581			node = of_find_node_by_path("/firmware");
   582			if (node) {
   583				of_platform_populate(node, NULL, NULL, NULL);
   584				of_node_put(node);
   585			}
   586	
   587			node = of_get_compatible_child(of_chosen, "simple-framebuffer");
   588			of_platform_device_create(node, NULL, NULL);
   589			of_node_put(node);
   590	
   591			/* Populate everything else. */
   592			of_platform_default_populate(NULL, NULL, NULL);
   593		}
   594	
   595		return 0;
   596	}
   597	arch_initcall_sync(of_platform_default_populate_init);
   598	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux