Re: [RFT] rtl8187: use DMA-aware buffers with usb_control_msg

From: Hin-Tak Leung
Date: Fri May 08 2009 - 19:20:38 EST


On Wed, May 6, 2009 at 7:02 PM, John W. Linville <linville@xxxxxxxxxxxxx> wrote:
> This definitely needs to fail more gracefully in the event of a
> kmalloc failure...
>
> Signed-off-by: John W. Linville <linville@xxxxxxxxxxxxx>

I am using this patch with compat-wireless with
2.6.29.2-134.fc11.x86_64 - presumably one needs to be using 2.6.30-rcX
to see any problems?

We mostly inherited that code concerned (and its style) from the vendor driver.

On Wed, May 6, 2009 at 7:45 AM, Greg KH <greg@xxxxxxxxx> wrote:

> Also it looks like rtl8225_write_8051() is incorrect. You are passing a
> pointer to a variable that was passed as an argument. I don't know
> where that is supposed to be on, somewhere on the stack I guess.
>
> Larry, care to fix this up?

I think John's patch resolves this issue to the extent it can -
rtl8225_write_8051() is called by rtl8225_write() which in turns gets
its input mostly in the form of magic contants (except a few
instances). So allocating a buffer and copying the magic contants in,
just before calling usb_control_msg() seems an acceptable way forward?

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