From: Johan Hovold Date: Tue, 8 Nov 2016 12:24:53 +0000 (+0100) Subject: tty: amiserial: fix invalid user-pointer check X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6f8ada1292904c8299daa019634b3cddcf2a31c3;p=linux-beck.git tty: amiserial: fix invalid user-pointer check Drop invalid user-pointer check from TIOCGSERIAL handler. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 208f573495dc..dfbb974927f2 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1012,8 +1012,6 @@ static int get_serial_info(struct tty_struct *tty, struct serial_state *state, { struct serial_struct tmp; - if (!retinfo) - return -EFAULT; memset(&tmp, 0, sizeof(tmp)); tty_lock(tty); tmp.line = tty->index;