Commit 9b5e0509 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Instead of BUG_ON exit out with error early

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b708a7d5
...@@ -238,8 +238,6 @@ static int tty_test_and_set(int bit, unsigned long *bitmap) ...@@ -238,8 +238,6 @@ static int tty_test_and_set(int bit, unsigned long *bitmap)
{ {
int ret; int ret;
BUG_ON(bit > (MAX_TTYS << 1));
ret = test_bit(bit, bitmap); ret = test_bit(bit, bitmap);
if (!ret) if (!ret)
set_bit(bit, bitmap); set_bit(bit, bitmap);
...@@ -905,6 +903,9 @@ static int verify_info(struct tty_info *info) ...@@ -905,6 +903,9 @@ static int verify_info(struct tty_info *info)
verify_termios(info->tfe->id, info->tie->termios)) verify_termios(info->tfe->id, info->tie->termios))
return -1; return -1;
if (info->tie->termios && info->tfe->tty_info_id > (MAX_TTYS << 1))
return -1;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment