[PATCH v2 1/2] arch: powerpc/kexec: Add missing of_node-put() in default_machine_kexec_prepare()

kbuild test robot lkp at intel.com
Tue Feb 26 03:09:08 AEDT 2019


Hi Himadri,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.0-rc8 next-20190225]
[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/Himadri-Pandya/arch-powerpc-kexec-Add-missing-of_node-put-in-default_machine_kexec_prepare/20190225-233822
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=powerpc 

All warnings (new ones prefixed by >>):

   arch/powerpc/kernel/machine_kexec_64.c: In function 'default_machine_kexec_prepare':
>> arch/powerpc/kernel/machine_kexec_64.c:67:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       if ((begin < high) && (end > low))
       ^~
   arch/powerpc/kernel/machine_kexec_64.c:69:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
        return -ETXTBSY;
        ^~~~~~

vim +/if +67 arch/powerpc/kernel/machine_kexec_64.c

fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  34  
3d1229d6 arch/powerpc/kernel/machine_kexec_64.c Michael Ellerman 2005-11-14  35  int default_machine_kexec_prepare(struct kimage *image)
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  36  {
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  37  	int i;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  38  	unsigned long begin, end;	/* limits of segment */
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  39  	unsigned long low, high;	/* limits of blocked memory range */
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  40  	struct device_node *node;
a7f67bdf arch/powerpc/kernel/machine_kexec_64.c Jeremy Kerr      2006-07-12  41  	const unsigned long *basep;
a7f67bdf arch/powerpc/kernel/machine_kexec_64.c Jeremy Kerr      2006-07-12  42  	const unsigned int *sizep;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  43  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  44  	/*
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  45  	 * Since we use the kernel fault handlers and paging code to
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  46  	 * handle the virtual mode, we must make sure no destination
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  47  	 * overlaps kernel static data or bss.
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  48  	 */
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  49  	for (i = 0; i < image->nr_segments; i++)
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  50  		if (image->segment[i].mem < __pa(_end))
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  51  			return -ETXTBSY;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  52  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  53  	/* We also should not overwrite the tce tables */
94db7c5e arch/powerpc/kernel/machine_kexec_64.c Anton Blanchard  2011-08-10  54  	for_each_node_by_type(node, "pci") {
e2eb6392 arch/powerpc/kernel/machine_kexec_64.c Stephen Rothwell 2007-04-03  55  		basep = of_get_property(node, "linux,tce-base", NULL);
e2eb6392 arch/powerpc/kernel/machine_kexec_64.c Stephen Rothwell 2007-04-03  56  		sizep = of_get_property(node, "linux,tce-size", NULL);
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  57  		if (basep == NULL || sizep == NULL)
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  58  			continue;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  59  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  60  		low = *basep;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  61  		high = low + (*sizep);
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  62  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  63  		for (i = 0; i < image->nr_segments; i++) {
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  64  			begin = image->segment[i].mem;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  65  			end = begin + image->segment[i].memsz;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  66  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25 @67  			if ((begin < high) && (end > low))
bd754146 arch/powerpc/kernel/machine_kexec_64.c Himadri Pandya   2019-02-25  68  				of_node_put(node);
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  69  				return -ETXTBSY;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  70  		}
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  71  	}
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  72  
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  73  	return 0;
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  74  }
fce0d574 arch/ppc64/kernel/machine_kexec.c      R Sharada        2005-06-25  75  

:::::: The code at line 67 was first introduced by commit
:::::: fce0d5740322b98b863f9e609f5a9bd4c06703af [PATCH] ppc64: kexec support for ppc64

:::::: TO: R Sharada <sharada at in.ibm.com>
:::::: CC: Linus Torvalds <torvalds at ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 59752 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20190226/73c102ee/attachment-0001.gz>


More information about the Linuxppc-dev mailing list