alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Hills <mark@xwax.org>
To: alsa-devel@alsa-project.org
Subject: [PATCH RFC 2/4] usb: Allow us to distinguish between different returns of EMSGSIZE
Date: Sun,  3 Mar 2013 17:57:35 +0000	[thread overview]
Message-ID: <1362333457-23895-2-git-send-email-mark@xwax.org> (raw)
In-Reply-To: <1362333457-23895-1-git-send-email-mark@xwax.org>

---
 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
-- 
1.7.12.1

  reply	other threads:[~2013-03-03 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03 17:53 usb: Endpoints sharing the same interface Mark Hills
2013-03-03 17:57 ` [PATCH RFC 1/4] snd-usb-audio: Playback and MIDI support for Novation Twitch DJ controller Mark Hills
2013-03-03 17:57   ` Mark Hills [this message]
2013-03-03 17:57   ` [PATCH RFC 3/4] snd-usb-audio: Trust fields given in the quirk Mark Hills
2013-03-03 17:57   ` [PATCH RFC 4/4] snd-usb-audio: Prototype capture support for Novation Twitch Mark Hills

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362333457-23895-2-git-send-email-mark@xwax.org \
    --to=mark@xwax.org \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).