From: Hiroshi Shimamoto Date: Fri, 19 Dec 2008 18:23:03 +0000 (-0800) Subject: printk: fix discarding message when recursion_bug X-Git-Tag: v2.6.29-rc1~572^2^5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=26cc271db798cf211d35967cbfbb53e997126b84;p=linux-2.6-omap-h63xx.git printk: fix discarding message when recursion_bug Impact: fix truncated recursion bug message printout When recursion_bug is true, kernel discards original message because printk_buf contains recursion_bug_msg with NULL terminator. The sizeof(recursion_bug_msg) makes this, use strlen() to get correct length without NULL terminator. Reported-by: Toshikazu Nakayama Signed-off-by: Hiroshi Shimamoto Signed-off-by: Ingo Molnar --- diff --git a/kernel/printk.c b/kernel/printk.c index f492f1583d7..e651ab05655 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -662,7 +662,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) if (recursion_bug) { recursion_bug = 0; strcpy(printk_buf, recursion_bug_msg); - printed_len = sizeof(recursion_bug_msg); + printed_len = strlen(recursion_bug_msg); } /* Emit the output into the temporary buffer */ printed_len += vscnprintf(printk_buf + printed_len,