Re: [linux-usb-devel] [PATCH] visor: Fix Oops on disconnect

nardelli
2004-05-21T21:44:31Z

Greg KH wrote:
> On Fri, May 21, 2004 at 03:51:23PM -0400, nardelli wrote:
>
>
> Patch is line-wrapped, so I can't apply it :(
>
>

Hmmm... I couldn't see the linewrap in the original I sent, or
in test ones that I did. Probably my mail tool, but then it
is getting late on a Friday, which probably means that it is me.

To aid in diagnosing where I'm goofing up, could you point out
a spot where it is linewrapping?

>>@@ -456,7 +460,8 @@ static void visor_close (struct usb_seri
>> return;
>>
>> /* shutdown our urbs */
>>- usb_unlink_urb (port->read_urb);
>>+ if (port->read_urb)
>>+ usb_unlink_urb (port->read_urb);
>
>
> I really do not think these extra checks for read_urb all of the place
> need to be added. We take care of it in the open() call, right?
>
>
>

Yes - less clutter and more efficient too.

>>+ else if (retval != sizeof(*connection_info)) {
>>+ /* real invalid connection info handling is below */
>>+ num_ports = 0;
>>+ }
>
>
> Change this to a "if" instead of a "else if".
> Actually just set num_ports to 0 at the beginning of the function, and
> then just check for a valud retval and do the code below...
>
>

Yep - same comment as above.

>>+ else {
>>+ connection_info = (struct visor_connection_info *)
>>+ transfer_buffer;
>
>
>
> greg k-h