From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id C42701EFAE9; Sat, 2 Jan 2016 18:49:11 -0500 (EST) Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by befuddled.reisers.ca (Postfix) with ESMTPS id 9444C1EFA94 for ; Sat, 2 Jan 2016 18:49:10 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id AD81A200D1; Sun, 3 Jan 2016 00:49:09 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fXB2iRuQfLrd; Sun, 3 Jan 2016 00:49:09 +0100 (CET) Received: from var.youpi.perso.aquilenet.fr (ABordeaux-655-1-111-28.w92-134.abo.wanadoo.fr [92.134.98.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 6E6F2200CC; Sun, 3 Jan 2016 00:49:09 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.86) (envelope-from ) id 1aFVv2-0002LL-Sq; Sun, 03 Jan 2016 00:49:08 +0100 Date: Sun, 3 Jan 2016 00:49:08 +0100 From: Samuel Thibault To: William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: speakup: Fix getting port information Message-ID: <20160102234908.GF2860@var.home> Mail-Followup-To: Samuel Thibault , William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20160102232529.GC2860@var.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160102232529.GC2860@var.home> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jan 2016 23:49:11 -0000 Samuel Thibault, on Sun 03 Jan 2016 00:25:29 +0100, wrote: > 5e6dc54 broke the port information in the speakup driver: > SERIAL_PORT_DFNS only gets defined if asm/serial.h is included. > > Along the way, make sure that we do have information for the requested > serial port number (index) (It'd be good to get this into 4.4 and 4.3.4). > Signed-off-by: Samuel Thibault > > --- a/drivers/staging/speakup/serialio.c > +++ b/drivers/staging/speakup/serialio.c > @@ -6,6 +6,9 @@ > #include "spk_priv.h" > #include "serialio.h" > > +#include > +#include > + > #ifndef SERIAL_PORT_DFNS > #define SERIAL_PORT_DFNS > #endif > @@ -26,6 +29,11 @@ const struct old_serial_port *spk_serial > const struct old_serial_port *ser = rs_table + index; > int err; > > + if (index > sizeof(rs_table) / sizeof(*rs_table)) { > + pr_info("no port info for ttyS%d\n", index); > + return NULL; > + } > + > /* Divisor, bytesize and parity */ > quot = ser->baud_base / baud; > cval = cflag & (CSIZE | CSTOPB); -- Samuel AUTHOR FvwmM4 is the result of a random bit mutation on a hard disk, presumably a result of a cosmic-ray or some such thing. (extrait de la page de man de FvwmM4)