diff options
author | Gary S. Robertson <gary.robertson@linaro.org> | 2015-09-09 14:34:49 -0500 |
---|---|---|
committer | Gary S. Robertson <gary.robertson@linaro.org> | 2015-09-09 14:34:49 -0500 |
commit | 60f13d2d65b7c0c4096321ee88670e56954ee215 (patch) | |
tree | d00f8c8159913c76970b2da3b2942ba08909bd1e /drivers/tty/n_tty.c | |
parent | fc6c8563fb89aaaab437f8215894219e54dfc5df (diff) | |
parent | 417f54239f760856db32c520ae542ff288145c13 (diff) |
Merge tag 'lsk-v3.18-15.08' of http://git.linaro.org/kernel/linux-linaro-stable into linux-linaro-lng-v3.18linux-lng-3.18.20-2015.09linux-linaro-lng-v3.18-test
LSK 15.08 v3.18
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Conflicts:
drivers/clocksource/exynos_mct.c
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 72824659f628..e3ebb674a693 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -186,6 +186,17 @@ static int receive_room(struct tty_struct *tty) return left; } +static inline int tty_copy_to_user(struct tty_struct *tty, + void __user *to, + const void *from, + unsigned long n) +{ + struct n_tty_data *ldata = tty->disc_data; + + tty_audit_add_data(tty, to, n, ldata->icanon); + return copy_to_user(to, from, n); +} + /** * n_tty_set_room - receive space * @tty: terminal @@ -2081,12 +2092,12 @@ static int canon_copy_from_read_buf(struct tty_struct *tty, __func__, eol, found, n, c, size, more); if (n > size) { - ret = copy_to_user(*b, read_buf_addr(ldata, tail), size); + ret = tty_copy_to_user(tty, *b, read_buf_addr(ldata, tail), size); if (ret) return -EFAULT; - ret = copy_to_user(*b + size, ldata->read_buf, n - size); + ret = tty_copy_to_user(tty, *b + size, ldata->read_buf, n - size); } else - ret = copy_to_user(*b, read_buf_addr(ldata, tail), n); + ret = tty_copy_to_user(tty, *b, read_buf_addr(ldata, tail), n); if (ret) return -EFAULT; |