From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbcABXtN (ORCPT ); Sat, 2 Jan 2016 18:49:13 -0500 Received: from sonata.ens-lyon.org ([140.77.166.138]:38108 "EHLO sonata.ens-lyon.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbcABXtL (ORCPT ); Sat, 2 Jan 2016 18:49:11 -0500 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)