]> git.baikalelectronics.ru Git - kernel.git/commit
n_tty: Don't wrap input buffer indices at buffer size
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 13:14:21 +0000 (09:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:43:00 +0000 (16:43 -0700)
commit6deff6a636bf8014289c25eda2e42398afe471cb
tree7d28526f720ac5460dde965c57d2fea1ed6410b3
parent921ff367d305ca0ba42d734ae818a426ac4a98ec
n_tty: Don't wrap input buffer indices at buffer size

Wrap read_buf indices (read_head, read_tail, canon_head) at
max representable value, instead of at the N_TTY_BUF_SIZE. This step
is necessary to allow lockless reads of these shared variables
(by updating the variables atomically).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c