Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933391AbcKHMZJ (ORCPT ); Tue, 8 Nov 2016 07:25:09 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:32852 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932398AbcKHMZH (ORCPT ); Tue, 8 Nov 2016 07:25:07 -0500 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 1/3] tty: amiserial: fix invalid user-pointer check Date: Tue, 8 Nov 2016 13:24:53 +0100 Message-Id: <1478607895-23447-2-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1478607895-23447-1-git-send-email-johan@kernel.org> References: <1478607895-23447-1-git-send-email-johan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 687 Lines: 25 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 --- drivers/tty/amiserial.c | 2 -- 1 file changed, 2 deletions(-) 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; -- 2.7.3