On Wednesday 14 June 2006 11:57 am, Alan Stern wrote: > On Tue, 13 Jun 2006, David Brownell wrote: > > > > > > error: > > > - usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma); > > > + if (buf) > > > + usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma); > > > usb_free_urb(urb); > > > > I think that's the wrong policy ... whatever code handles that call should > > be able to handle "buf == NULL". Such tests don't need to be scattered > > through all the drivers... > > You missed the point of this change. If buf is NULL then there's a good > chance that urb is NULL also (see the code that comes before). We don't > want to try to dereference urb->transfer_dma in that case... > > Okay, yes, I could have tested urb instead of buf. It seemed better to > make the more specific test.
The more specific test would be "if (urb)". This one is just confusing. _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel