lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Apr 2022 03:34:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Wan Jiabing <wanjiabing@...o.com>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, kael_w@...h.net,
        Wan Jiabing <wanjiabing@...o.com>
Subject: Re: [PATCH] of: Add missing of_node_put() before return

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: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20220422/202204220349.GgbfoMrp-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
        # 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
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/

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

All errors (new ones prefixed by >>):

   drivers/of/platform.c: In function 'of_platform_default_populate_init':
>> drivers/of/platform.c:560:50: error: expected ';' before 'return'
     560 |                                 of_node_put(node)
         |                                                  ^
         |                                                  ;
     561 |                                 return -ENOMEM;
         |                                 ~~~~~~            


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ