Commit eaaa2249 authored by Georgi Guninski's avatar Georgi Guninski Committed by Linus Torvalds

[PATCH] Fix sign checks in copy_from_read_buf()

Fix signedness and remove the now unnecessary cast.
Acked-by: default avatarMarcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 59fe8d99
......@@ -1143,13 +1143,13 @@ static inline int copy_from_read_buf(struct tty_struct *tty,
{
int retval;
ssize_t n;
size_t n;
unsigned long flags;
retval = 0;
spin_lock_irqsave(&tty->read_lock, flags);
n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
n = min((ssize_t)*nr, n);
n = min(*nr, n);
spin_unlock_irqrestore(&tty->read_lock, flags);
if (n) {
mb();
......
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