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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux