console: limit the range of VGACON_SOFT_SCROLLBACK_SIZE
authorAmerigo Wang <amwang@redhat.com>
Fri, 5 Mar 2010 21:44:17 +0000 (13:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:46 +0000 (11:26 -0800)
BuraphaLinux reported that we will trigger a mm warning when we
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=65536, this is because mm cann't
allocate so many pages.  We should limit the range of
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, don't give a user any chance to
trigger that.

Reported-by: BuraphaLinux Server <buraphalinuxserver@gmail.com>
Tested-by: BuraphaLinux Server <buraphalinuxserver@gmail.com>
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/console/Kconfig

index fc7d9bbb548c4637e329080d2ca6110bff86cd75..8e8f18d29d7ae5258705244710d160a3107dbe23 100644 (file)
@@ -37,6 +37,7 @@ config VGACON_SOFT_SCROLLBACK
 config VGACON_SOFT_SCROLLBACK_SIZE
        int "Scrollback Buffer Size (in KB)"
        depends on VGACON_SOFT_SCROLLBACK
+       range 1 1024
        default "64"
        help
          Enter the amount of System RAM to allocate for the scrollback