diff mbox series

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

Message ID 20190227095138.30263-1-himadri18.07@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v3,1/2] arch: powerpc/kexec: Add missing of_node-put() in default_machine_kexec_prepare() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch warning total: 0 errors, 0 warnings, 2 checks, 11 lines checked

Commit Message

Himadri Pandya Feb. 27, 2019, 9:51 a.m. UTC
Decrement the reference count on device_node "node" while breaking out
of the loop. Issue identified by Coccinelle.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
---
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(-)
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index a0f6f45005bd..ef484a25fc50 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -64,8 +64,10 @@  int default_machine_kexec_prepare(struct kimage *image)
 			begin = image->segment[i].mem;
 			end = begin + image->segment[i].memsz;
 
-			if ((begin < high) && (end > low))
+			if ((begin < high) && (end > low)) {
+				of_node_put(node);
 				return -ETXTBSY;
+			}
 		}
 	}