diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-10-18 16:26:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 19:50:54 -0400 |
commit | 6c633f27ccf783e9a782b84e34aeaeb7949a3359 (patch) | |
tree | 66180a876a5ff6c7d81672b725288ff4c83f80d9 /drivers/tty/n_tty.c | |
parent | 3383427a7b325e50af03d6f42b9587ca66d941a6 (diff) |
TTY: audit, stop accessing tty->icount
This is a private member of n_tty. Stop accessing it. Instead, take is
as an argument.
This is needed to allow clean switch of the private members to a
separate private structure of n_tty.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index ceae0744cbb8..3ebab0cfceb2 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -76,7 +76,7 @@ | |||
76 | static inline int tty_put_user(struct tty_struct *tty, unsigned char x, | 76 | static inline int tty_put_user(struct tty_struct *tty, unsigned char x, |
77 | unsigned char __user *ptr) | 77 | unsigned char __user *ptr) |
78 | { | 78 | { |
79 | tty_audit_add_data(tty, &x, 1); | 79 | tty_audit_add_data(tty, &x, 1, tty->icanon); |
80 | return put_user(x, ptr); | 80 | return put_user(x, ptr); |
81 | } | 81 | } |
82 | 82 | ||
@@ -1644,7 +1644,8 @@ static int copy_from_read_buf(struct tty_struct *tty, | |||
1644 | n -= retval; | 1644 | n -= retval; |
1645 | is_eof = n == 1 && | 1645 | is_eof = n == 1 && |
1646 | tty->read_buf[tty->read_tail] == EOF_CHAR(tty); | 1646 | tty->read_buf[tty->read_tail] == EOF_CHAR(tty); |
1647 | tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n); | 1647 | tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n, |
1648 | tty->icanon); | ||
1648 | spin_lock_irqsave(&tty->read_lock, flags); | 1649 | spin_lock_irqsave(&tty->read_lock, flags); |
1649 | tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); | 1650 | tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); |
1650 | tty->read_cnt -= n; | 1651 | tty->read_cnt -= n; |