mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Lotfi Manseur <lotfi.manseur@gmail.com>
Cc: stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Wojciech M Zabolotny <W.Zabolotny@elka.pw.edu.pl>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Lotfi Manseur <lotfi.manseur@imag.fr>, Willy Tarreau <w@1wt.eu>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
Date: Thu, 13 Jun 2013 04:35:54 +0100	[thread overview]
Message-ID: <1371094554.10688.42.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1370610872-1309-1-git-send-email-lotfi.manseur@imag.fr>

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]

On Fri, 2013-06-07 at 15:14 +0200, Lotfi Manseur wrote:
> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> a816e3113b63753c330ca4751ea1d208e93e3015.
> 
> This is to be fixed in longterm 2.6.32.60 and 3.4.47.
> This bug has been found with coccinelle.
> 
> Signed-off-by: Lotfi Manseur <lotfi.manseur@imag.fr>
> Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>

I've queued up those changes for 3.2.  This backported version seems
nicer, but we generally prefer to use patches that are as close as
possible to those in mainline.

Ben.

> ---
>  drivers/usb/serial/ftdi_sio.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index c374beb..615bd9e 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -2364,7 +2364,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  
>  	cflag = termios->c_cflag;
>  
> -	if (old_termios->c_cflag == termios->c_cflag
> +	if (old_termios
> +	    && old_termios->c_cflag == termios->c_cflag
>  	    && old_termios->c_ispeed == termios->c_ispeed
>  	    && old_termios->c_ospeed == termios->c_ospeed)
>  		goto no_c_cflag_changes;
> @@ -2373,7 +2374,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  	   ftdi_sio_read_bulk_callback  - need to examine what this means -
>  	   don't see any problems yet */
>  
> -	if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
> +	if (old_termios &&
> +	    (old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
>  	    (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
>  		goto no_data_parity_stop_changes;
>  

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2013-06-13  3:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 13:14 Lotfi Manseur
2013-06-07 13:47 ` Willy Tarreau
2013-06-07 13:56 ` Sergei Shtylyov
2013-06-07 17:30 ` Greg Kroah-Hartman
2013-06-07 18:49   ` Willy Tarreau
2013-06-10 21:03 ` Greg Kroah-Hartman
2013-06-13  3:35 ` Ben Hutchings [this message]
2013-06-17 15:30   ` Nicolas Palix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371094554.10688.42.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=W.Zabolotny@elka.pw.edu.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lotfi.manseur@gmail.com \
    --cc=lotfi.manseur@imag.fr \
    --cc=nicolas.palix@imag.fr \
    --cc=stable@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®