]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: storage gadgets send wrong error code for unknown commands
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 11 Apr 2012 20:09:10 +0000 (16:09 -0400)
committerFelipe Balbi <balbi@ti.com>
Thu, 12 Apr 2012 13:20:10 +0000 (16:20 +0300)
commit4484c401ab52af7176dfd3a23ec50845f2c9287c
tree4ff3f3addfbed73df3e0ff92f9c39cec8e831566
parentaace49f4dc66f638f8fdf1336ebe0a034c387fa9
USB: gadget: storage gadgets send wrong error code for unknown commands

This patch (as1539) fixes a minor bug in the mass-storage gadget
drivers.  When an unknown command is received, the error code sent
back is "Invalid Field in CDB" rather than "Invalid Command".  This is
because the bitmask of CDB bytes allowed to be nonzero is incorrect.

When handling an unknown command, we don't care which command bytes
are nonzero.  All the bits in the mask should be set, not just eight
of them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <Michal Nazarewicz <mina86@mina86.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_mass_storage.c
drivers/usb/gadget/file_storage.c