Decrement the reference count on device_node "node" while breaking out
of the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
arch/powerpc/kernel/machine_kexec_64.c | 1 +
1 file changed, 1 insertion(+)
Decrement the reference count on device_node "np" while breaking out of
the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 [off-list ref]
:::::: CC: Linus Torvalds [off-list ref]
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Decrement the reference count on device_node "node" while breaking out
of the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
arch/powerpc/kernel/machine_kexec_64.c | 1 +
1 file changed, 1 insertion(+)
@@ -65,6 +65,7 @@ int default_machine_kexec_prepare(struct kimage *image)end=begin+image->segment[i].memsz;if((begin<high)&&(end>low))+of_node_put(node);return-ETXTBSY;
I think the kbuild robot already caught this, but you need to add { } block
around this if now. Previously it was a one line statement, but adding the
of_node_put() makes it multiple lines that now require { }.
-Tyrel
Decrement the reference count on device_node "np" while breaking out of
the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Decrement the reference count on device_node "node" while breaking out
of the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
Changes in V3:
- Add braces around the if block
---
arch/powerpc/kernel/machine_kexec_64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Decrement the reference count on device_node "np" while breaking out of
the loop. Issue identified by Coccinelle.
Signed-off-by: Himadri Pandya <redacted>
---
Changes in V2:
- Change subject line
---
Changes in V3:
- Do not remove the blank line at end of the file
---
arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)