All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: kexec@lists.infradead.org
Cc: horms@verge.net.au, s.neumann@raumfeld.com,
	Daniel Mack <zonque@gmail.com>
Subject: [PATCH 1/2] fs2dt: fix basename string compares
Date: Mon, 26 Nov 2012 13:14:42 +0100	[thread overview]
Message-ID: <1353932083-8710-1-git-send-email-zonque@gmail.com> (raw)

basename is initialized as

  basename = strrchr(pathname,'/') + 1;

and does hence not contain the leading slash character.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 kexec/fs2dt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c
index b7eda8f..79258a1 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 && !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];
-- 
1.7.11.7


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

             reply	other threads:[~2012-11-26 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 12:14 Daniel Mack [this message]
2012-11-26 12:14 ` [PATCH 2/2] fs2dt: check for initrd_size != 0 when adding initrd entries Daniel Mack
2012-11-27  2:30   ` Simon Horman
2012-11-27  2:29 ` [PATCH 1/2] fs2dt: fix basename string compares Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353932083-8710-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=s.neumann@raumfeld.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.