lkml.org 
[lkml]   [2014]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arm: early_printk: do bound check independent of @n
Date
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


\
 
 \ /
  Last update: 2014-11-21 21:01    [W:2.075 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site