lkml.org 
[lkml]   [2009]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] usb hcd: poll hcd device to force writes
On Tue, 12 May 2009, Jason Wessel wrote:

> This patch takes the route of forcibly polling the hcd device to drain
> the urb queue in order to initiate the bulk write call backs. This
> only happens if the device is a usb serial console device that sets
> the max_in_flight_urbs in the serial device structure.

> +void
> +usb_hcd_poll_urb_irq(struct urb *urb)
> +{
> + struct usb_hcd *hcd;
> +
> + if (!urb)
> + return;

Is this test really needed? The routine is called from only one spot,
after all. It seems more likely that urb will point to deallocated
memory than that it will be NULL. Do you protect against this in
usb_do_console_write?

Maybe you should pass a pointer to a usb_bus structure rather than an
URB. Then none of these issues would arise.

> +
> + hcd = bus_to_hcd(urb->dev->bus);
> + if (hcd)
> + usb_hcd_irq(0, hcd);

This test too looks strange, since it can never fail. (See the
definition of bus_to_hcd to find out why...)

Alan Stern




\
 
 \ /
  Last update: 2009-05-13 04:29    [W:0.044 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site