aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/urb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r--drivers/usb/core/urb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 16927fa88fbd..e75115a04a2e 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -7,6 +7,7 @@
7#include <linux/usb.h> 7#include <linux/usb.h>
8#include <linux/wait.h> 8#include <linux/wait.h>
9#include <linux/usb/hcd.h> 9#include <linux/usb/hcd.h>
10#include <linux/scatterlist.h>
10 11
11#define to_urb(d) container_of(d, struct urb, kref) 12#define to_urb(d) container_of(d, struct urb, kref)
12 13
@@ -413,6 +414,13 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
413 urb->iso_frame_desc[n].status = -EXDEV; 414 urb->iso_frame_desc[n].status = -EXDEV;
414 urb->iso_frame_desc[n].actual_length = 0; 415 urb->iso_frame_desc[n].actual_length = 0;
415 } 416 }
417 } else if (dev->speed != USB_SPEED_WIRELESS && urb->num_sgs) {
418 struct scatterlist *sg;
419 int i;
420
421 for_each_sg(urb->sg, sg, urb->num_sgs - 1, i)
422 if (sg->length % max)
423 return -EINVAL;
416 } 424 }
417 425
418 /* the I/O buffer must be mapped/unmapped, except when length=0 */ 426 /* the I/O buffer must be mapped/unmapped, except when length=0 */