--- drivers/usb/core/urb.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index e0d9d94..7f00213 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -408,16 +408,24 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) return -EINVAL; for (n = 0; n < urb->number_of_packets; n++) { len = urb->iso_frame_desc[n].length; - if (len < 0 || len > max) + if (len < 0 || len > max) { + dev_dbg(&dev->dev, + "bad packet length %d (max %d)", + len, max); return -EMSGSIZE; + } urb->iso_frame_desc[n].status = -EXDEV; urb->iso_frame_desc[n].actual_length = 0; } }
/* the I/O buffer must be mapped/unmapped, except when length=0 */ - if (urb->transfer_buffer_length > INT_MAX) + if (urb->transfer_buffer_length > INT_MAX) { + dev_dbg(&dev->dev, + "transfer buffer length (%d) too large", + urb->transfer_buffer_length); return -EMSGSIZE; + }
#ifdef DEBUG /* stuff that drivers shouldn't do, but which shouldn't