fs2dt: fix basename string compares
Subsystems (2)
PATCH 1/2 fs2dt: fix basename string compares
basename is initialized as
basename = strrchr(pathname,'/') + 1;
and does hence not contain the leading slash character.
--- kexec/fs2dt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/fs2dt.c +2 -2
@@ -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 && !strcmp (basename,"chosen/" )) {int len =8 ;unsigned long long initrd_end;
@@ -554,7 +554,7 @@ static void putnode(void)/* Add cmdline to the second kernel. Check to see if the new * cmdline has a root=. If not, use the old root= cmdline. */ -if (!strcmp (basename,"/chosen/" )) { +if (!strcmp (basename,"chosen/" )) {size_t cmd_len =0 ;char *param =NULL ;char filename[MAXPATH ];
Signature · 7 lines
1.7.11.7 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 2/2 fs2dt: check for initrd_size != 0 when adding initrd entries
This prevents the creation of chosen/linux,initrd-{start,stop} entries with zero length.
--- kexec/fs2dt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kexec/fs2dt.c +1 -1
@@ -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;
Signature · 7 lines
1.7.11.7 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedRe: [PATCH 2/2] fs2dt: check for initrd_size != 0 when adding initrd entries
Quoted 4 lines · Daniel Mack
This prevents the creation of chosen/linux,initrd-{start,stop} entries with zero length.
Signed-off-by Daniel Mack <[email protected]>
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 5 lines · Daniel Mack
basename is initialized as
basename = strrchr(pathname,'/') + 1;and does hence not contain the leading slash character.
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec