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

Himadri Pandya himadri18.07 at gmail.com
Mon Feb 25 20:00:55 AEDT 2019


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 at gmail.com>
---
Changes in V2:
	- Change subject line
---
 arch/powerpc/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index a0f6f45005bd..46edde582984 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -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;
 		}
 	}
-- 
2.17.1



More information about the Linuxppc-dev mailing list