diff options
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 24146142bc0..a1d702c1313 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -684,8 +684,19 @@ static void call_console_drivers(unsigned start, unsigned end) | |||
684 | start_print = start; | 684 | start_print = start; |
685 | while (cur_index != end) { | 685 | while (cur_index != end) { |
686 | if (msg_level < 0 && ((end - cur_index) > 2)) { | 686 | if (msg_level < 0 && ((end - cur_index) > 2)) { |
687 | /* | ||
688 | * prepare buf_prefix, as a contiguous array, | ||
689 | * to be processed by log_prefix function | ||
690 | */ | ||
691 | char buf_prefix[SYSLOG_PRI_MAX_LENGTH+1]; | ||
692 | unsigned i; | ||
693 | for (i = 0; i < ((end - cur_index)) && (i < SYSLOG_PRI_MAX_LENGTH); i++) { | ||
694 | buf_prefix[i] = LOG_BUF(cur_index + i); | ||
695 | } | ||
696 | buf_prefix[i] = '\0'; /* force '\0' as last string character */ | ||
697 | |||
687 | /* strip log prefix */ | 698 | /* strip log prefix */ |
688 | cur_index += log_prefix(&LOG_BUF(cur_index), &msg_level, NULL); | 699 | cur_index += log_prefix((const char *)&buf_prefix, &msg_level, NULL); |
689 | start_print = cur_index; | 700 | start_print = cur_index; |
690 | } | 701 | } |
691 | while (cur_index != end) { | 702 | while (cur_index != end) { |