linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arjun024@gmail.com (Arjun Sreedharan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: early_printk: do bound check independent of @n
Date: Sat, 22 Nov 2014 00:58:36 +0530	[thread overview]
Message-ID: <1416598116-2461-1-git-send-email-arjun024@gmail.com> (raw)

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
---
 arch/arm/kernel/early_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c
index 4307653..9e05f8a 100644
--- a/arch/arm/kernel/early_printk.c
+++ b/arch/arm/kernel/early_printk.c
@@ -16,7 +16,7 @@ extern void printch(int);
 
 static void early_write(const char *s, unsigned n)
 {
-	while (n-- > 0) {
+	while (*s && n-- > 0) {
 		if (*s == '\n')
 			printch('\r');
 		printch(*s);
-- 
1.7.11.7

                 reply	other threads:[~2014-11-21 19:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1416598116-2461-1-git-send-email-arjun024@gmail.com \
    --to=arjun024@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).