lkml.org 
[lkml]   [2004]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] [PATCH] visor: Fix Oops on disconnect
Greg KH wrote:
> On Mon, May 24, 2004 at 05:42:54PM -0400, nardelli wrote:
>
>
> Nah, this is good enough. I've tweaked the patch a bit to keep from
> creating a big structure on the stack, and reduced the copy port logic
> to something a bit more readable and applied this version. I'll send it
> off to Linus in a day or so.
>
> Thanks a lot for your work on this.
>
> greg k-h
>
> +#define COPY_PORT(dest, src) \
> + dest->read_urb = src->read_urb; \
> + dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress; \
> + dest->bulk_in_buffer = src->bulk_in_buffer; \
> + dest->interrupt_in_urb = src->interrupt_in_urb; \
> + dest->interrupt_in_endpointAddress = src->interrupt_in_endpointAddress; \
> + dest->interrupt_in_buffer = src->interrupt_in_buffer;
> +
> + swap_port = kmalloc(sizeof(*swap_port), GFP_KERNEL);
> + if (!swap_port)
> + return -ENOMEM;
> + COPY_PORT(swap_port, serial->port[0]);
> + COPY_PORT(serial->port[0], serial->port[1]);
> + COPY_PORT(serial->port[1], swap_port);
> + kfree(swap_port);
>
> return 0;
> }
> -

That's definitely less error prone as well.

BTW - I appreciate the time that you have put into this, and especially
the constructive comments and patience that you had regarding patches
that I submitted.

--
Joe Nardelli
jnardelli@infosciences.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.474 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site