Re: [PATCH] tty: Fix various bogus WARN checks in the usb serial layer

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

 



On Wed, 10 Feb 2010, Oliver Neukum wrote:

> Am Dienstag, 9. Februar 2010 17:30:20 schrieb Alan Stern:
> > @@ -530,23 +526,19 @@ static void aircable_read_bulk_callback(
> >         }
> >         tty_kref_put(tty);
> >  
> > -       /* Schedule the next read if we are still open */
> > -       if (port->port.count) {
> > -               usb_fill_bulk_urb(port->read_urb, port->serial->dev,
> > -                                 usb_rcvbulkpipe(port->serial->dev,
> > -                                         port->bulk_in_endpointAddress),
> > -                                 port->read_urb->transfer_buffer,
> > -                                 port->read_urb->transfer_buffer_length,
> > -                                 aircable_read_bulk_callback, port);
> > -
> > -               result = usb_submit_urb(urb, GFP_ATOMIC);
> > -               if (result)
> > -                       dev_err(&urb->dev->dev,
> > -                               "%s - failed resubmitting read urb, error %d\n",
> > -                               __func__, result);
> > -       }
> > -
> > -       return;
> > +       /* Schedule the next read */
> > +       usb_fill_bulk_urb(port->read_urb, port->serial->dev,
> > +                         usb_rcvbulkpipe(port->serial->dev,
> > +                                 port->bulk_in_endpointAddress),
> > +                         port->read_urb->transfer_buffer,
> > +                         port->read_urb->transfer_buffer_length,
> > +                         aircable_read_bulk_callback, port);
> > +
> > +       result = usb_submit_urb(urb, GFP_ATOMIC);
> > +       if (result)
> > +               dev_err(&urb->dev->dev,
> > +                       "%s - failed resubmitting read urb, error %d\n",
> > +                       __func__, result);
> 
> The function is unimpaired, but you emit an error message to the log
> when you close. You should check for -EPERM.

It's unlikely to happen.  Under normal circumstances this error message
won't appear, because the previous read URB would have been killed and
so we wouldn't reach this point.

Of course, the device could be closed just as some new data is
received.  (And other drivers have the same issue as aircable.c -- and
have had it all along.)  Should I go ahead and add the test?

Alan Stern

--
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