viafb: fix crashes due to 4k stack overflow
commite687d691cb3790d25e31c74f5941fd7c565e9df5
authorBruno Prémont <bonbons@linux-vserver.org>
Sun, 4 Jan 2009 21:11:54 +0000 (4 13:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Jan 2009 21:33:20 +0000 (4 13:33 -0800)
treed606511c734e99fb6e4786d20ab42a8cf1b2232f
parentc644f0e4b56f9a2fc066cd0d75a18074d130e4a3
viafb: fix crashes due to 4k stack overflow

The function viafb_cursor() uses 2 stack-variables of CURSOR_SIZE bits;
CURSOR_SIZE is defined as (8 * 1024).  Using up twice 1k on stack is too
much for 4k-stack (though it works with 8k-stacks).  Make those two
variables kzalloc'ed to preserve stack space.

Also merge the whole lot of local struct's in viafb_ioctl into a union so
the stack usage gets minimized here as well.  (struct's are only accessed
in their indicidual IOCTL case) This second part is only compile-tested as
I know of no userspace app using the IOCTLs.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: <JosephChan@via.com.tw>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/via/viafbdev.c