Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12943f097e5a4a0550f52f98ab8f476435e2ce15
Commit:     12943f097e5a4a0550f52f98ab8f476435e2ce15
Parent:     94d0f7eac77a84da2cee41b8038796891f75f09e
Author:     Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 24 16:27:50 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:20 2007 -0700

    USB: less-restrictive command checking in g-file-storage
    
    This patch (as983) makes a test for minimum-length command sizes in
    g_file_storage less restrictive.  It doesn't matter because commands
    with bad lengths will be detected later on anyway, and doing it like
    this makes the driver interoperable with certain buggy hosts such as
    the JVC HiFi (reported by Samuel Hangouet).
    
    Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/file_storage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/file_storage.c 
b/drivers/usb/gadget/file_storage.c
index 9998cd7..0551140 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -2964,7 +2964,7 @@ static int received_cbw(struct fsg_dev *fsg, struct 
fsg_buffhd *bh)
 
        /* Is the CBW meaningful? */
        if (cbw->Lun >= MAX_LUNS || cbw->Flags & ~USB_BULK_IN_FLAG ||
-                       cbw->Length < 6 || cbw->Length > MAX_COMMAND_SIZE) {
+                       cbw->Length <= 0 || cbw->Length > MAX_COMMAND_SIZE) {
                DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, "
                                "cmdlen %u\n",
                                cbw->Lun, cbw->Flags, cbw->Length);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to