Re: [PATCH 001/001] USB: serial: sierra driver indat_callback fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2010-02-01 at 14:05 -0800, Greg KH wrote:
> On Thu, Jan 28, 2010 at 05:40:53PM -0800, Elina Pasheva wrote:
> > Subject: [PATCH 001/001] USB: serial: sierra driver indat_callback fix
> > From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>
> > 
> > A crash has been reported with sierra driver on disconnect with
> > Ubuntu/Lucid distribution based on kernel-2.6.32.
> > The cause of the crash was determined as "NULL tty pointer 
> > was being referenced" and the NULL pointer was passed by
> > sierra_indat_callback().
> > This patch modifies sierra_indat_callback() function to check 
> > for NULL tty structure pointer. This modification prevents 
> > a crash from happening when the device is disconnected.
> > This patch fixes the bug reported in Launchpad: 
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/511157
> > Signed-off-by: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>
> > 
> >  drivers/usb/serial/sierra.c |   19 +++++++++++--------
> >  1 file changed, 11 insertions(+), 8 deletions(-)
> > 
> > --- a/drivers/usb/serial/sierra.c       2010-01-28 15:26:09.000000000 -0800
> > +++ b/drivers/usb/serial/sierra.c       2010-01-28 15:28:15.000000000 -0800
> > @@ -603,14 +603,17 @@ static void sierra_indat_callback(struct
> >         } else {
> >                 if (urb->actual_length) {
> >                         tty = tty_port_tty_get(&port->port);
> > -
> > -                       tty_buffer_request_room(tty, urb->actual_length);
> > -                       tty_insert_flip_string(tty, data, urb->actual_length);
> > -                       tty_flip_buffer_push(tty);
> > -
> > -                       tty_kref_put(tty);
> > -                       usb_serial_debug_data(debug, &port->dev, __func__,
> > -                               urb->actual_length, data);
> > +                       if (tty) {
> > +                               tty_buffer_request_room(tty,
> > +                                       urb->actual_length);
> > +                               tty_insert_flip_string(tty, data,
> > +                                       urb->actual_length);
> > +                               tty_flip_buffer_push(tty);
> > +
> > +                               tty_kref_put(tty);
> > +                               usb_serial_debug_data(debug, &port->dev,
> > +                                       __func__, urb->actual_length, data);
> > +                       }
> >                 } else {
> >                         dev_dbg(&port->dev, "%s: empty read urb"
> >                                 " received\n", __func__);
> 
> Your patch has no tabs, your email client ate them up and spit out
> spaces, so this patch can not be applied :(
> 
> greg k-h
> 
Sorry, Greg for the wrong format.
I just re-submitted the patch.
I use Evolution email client, and set the 'Format' to 'Preformatted';
then inserted the patch as a text file.
Hope this time I got it right.

Thanks,
Elina


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux