Commit a613842d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Fix slave peer index accounting

We need to test every even index (which represents a slave
peer) thus use modulo operation here.
Reported-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 11f8bb47
...@@ -167,7 +167,7 @@ int tty_verify_active_pairs(void) ...@@ -167,7 +167,7 @@ int tty_verify_active_pairs(void)
unsigned long i, unpaired_slaves = 0; unsigned long i, unpaired_slaves = 0;
for_each_bit(i, tty_active_pairs) { for_each_bit(i, tty_active_pairs) {
if (is_log2(i)) { if ((i % 2) == 0) {
if (test_bit(i + 1, tty_active_pairs)) { if (test_bit(i + 1, tty_active_pairs)) {
i++; i++;
continue; continue;
......
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