aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/mconsole_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-29 04:58:52 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:04 -0400
commitf92afe56a0dcd271cb94e12acf1861d44c3faefd (patch)
tree4c8fc05c2dd6d9142ab3e5850ccbb5ff7b0065d1 /arch/um/drivers/mconsole_kern.c
parent80c13749140284abdc23bbeed2507b7e5a3dc459 (diff)
[PATCH] uml: stack consumption reduction
Fix some stack abuse in the sysrq t path. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/mconsole_kern.c')
-rw-r--r--arch/um/drivers/mconsole_kern.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 79610b5ce67e..773a134e7fdb 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -598,6 +598,11 @@ out:
598 mconsole_reply(req, err_msg, err, 0); 598 mconsole_reply(req, err_msg, err, 0);
599} 599}
600 600
601struct mconsole_output {
602 struct list_head list;
603 struct mc_request *req;
604};
605
601static DEFINE_SPINLOCK(console_lock); 606static DEFINE_SPINLOCK(console_lock);
602static LIST_HEAD(clients); 607static LIST_HEAD(clients);
603static char console_buf[MCONSOLE_MAX_DATA]; 608static char console_buf[MCONSOLE_MAX_DATA];
@@ -622,10 +627,10 @@ static void console_write(struct console *console, const char *string,
622 return; 627 return;
623 628
624 list_for_each(ele, &clients){ 629 list_for_each(ele, &clients){
625 struct mconsole_entry *entry; 630 struct mconsole_output *entry;
626 631
627 entry = list_entry(ele, struct mconsole_entry, list); 632 entry = list_entry(ele, struct mconsole_output, list);
628 mconsole_reply_len(&entry->request, console_buf, 633 mconsole_reply_len(entry->req, console_buf,
629 console_index, 0, 1); 634 console_index, 0, 1);
630 } 635 }
631 636
@@ -649,10 +654,10 @@ late_initcall(mc_add_console);
649static void with_console(struct mc_request *req, void (*proc)(void *), 654static void with_console(struct mc_request *req, void (*proc)(void *),
650 void *arg) 655 void *arg)
651{ 656{
652 struct mconsole_entry entry; 657 struct mconsole_output entry;
653 unsigned long flags; 658 unsigned long flags;
654 659
655 entry.request = *req; 660 entry.req = req;
656 list_add(&entry.list, &clients); 661 list_add(&entry.list, &clients);
657 spin_lock_irqsave(&console_lock, flags); 662 spin_lock_irqsave(&console_lock, flags);
658 663