Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932852Ab3JKUJG (ORCPT ); Fri, 11 Oct 2013 16:09:06 -0400 Received: from mail-ea0-f174.google.com ([209.85.215.174]:63370 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932472Ab3JKUJB (ORCPT ); Fri, 11 Oct 2013 16:09:01 -0400 Date: Fri, 11 Oct 2013 22:08:49 +0200 (CEST) From: Roel Kluin To: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Subject: tty: incorrect test of echo_buf() result for ECHO_OP_START Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 969 Lines: 25 Untested, but this looks like a bug to me ----------- test echo_buf() result for ECHO_OP_START Signed-off-by: Roel Kluin --- diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 7a744b6..42b6cca 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -767,7 +767,7 @@ static size_t __process_echoes(struct tty_struct *tty) * of echo overrun before the next commit), then discard enough * data at the tail to prevent a subsequent overrun */ while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { - if (echo_buf(ldata, tail == ECHO_OP_START)) { + if (echo_buf(ldata, tail) == ECHO_OP_START) { if (echo_buf(ldata, tail) == ECHO_OP_ERASE_TAB) tail += 3; else -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/