Skip to content

Commit

Permalink
usb/hcd: Ensure scatter-gather is not used for isoc transfers
Browse files Browse the repository at this point in the history
We don't support sg for isoc transfers, enforce this.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jwrdegoede authored and gregkh committed Jul 9, 2012
1 parent c5cf921 commit fe2072c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,15 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
&& !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)) {
if (hcd->self.uses_dma) {
if (urb->num_sgs) {
int n = dma_map_sg(
int n;

/* We don't support sg for isoc transfers ! */
if (usb_endpoint_xfer_isoc(&urb->ep->desc)) {
WARN_ON(1);
return -EINVAL;
}

n = dma_map_sg(
hcd->self.controller,
urb->sg,
urb->num_sgs,
Expand Down

0 comments on commit fe2072c

Please sign in to comment.