[PATCH 2/2] fs2dt: check for initrd_size != 0 when adding initrd entries

Daniel Mack zonque at gmail.com
Mon Nov 26 07:14:43 EST 2012


This prevents the creation of chosen/linux,initrd-{start,stop} entries
with zero length.

Signed-off-by: Daniel Mack <zonque at gmail.com>
---
 kexec/fs2dt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c
index 79258a1..5d933c8 100644
--- a/kexec/fs2dt.c
+++ b/kexec/fs2dt.c
@@ -525,7 +525,7 @@ static void putnode(void)
 	putprops(dn, namelist, numlist);
 
 	/* Add initrd entries to the second kernel */
-	if (initrd_base && !strcmp(basename,"chosen/")) {
+	if (initrd_base && initrd_size && !strcmp(basename,"chosen/")) {
 		int len = 8;
 		unsigned long long initrd_end;
 
-- 
1.7.11.7




More information about the kexec mailing list