Re: [PATCH] usb: core: Warn if an URB's transfer_buffer is on stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 23 Apr 2017, Florian Fainelli wrote:

> > In that case, it would be better to move the warning to a central place
> > where it will always get triggered, such as map_urb_for_dma().  As it
> > is, the patch will only issue a warning for callers of usb_bulk_msg(),
> > usb_interrupt_msg(), or usb_control_msg().
> 
> map_urb_for_dma() seems like a better location indeed, let me submit a
> v2 with that then.
> 
> Most HCDs implementation that define a map_urb_for_dma function pointer
> also call usb_hcd_map_urb_for_dma() (except for max3421-hcd.c) so would
> it be better to move the is_object_on_stack() check in
> usb_hcd_map_urb_for_dma() for consistency with the existing
> is_vmalloc_addr() check?

Or maybe move the is_vmalloc_addr() check to map_urb_for_dma().

The only issue is that some weird HCD might sometimes not need to do
the DMA mapping (it might use PIO for some types of transfer).  In
those cases we don't want to issue the warning.  So perhaps 
usb_hcd_map_urb_for_dma() would be better for both checks.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux