audk/MdeModulePkg/Bus/Usb/UsbBusDxe
Michael D Kinney b4e96b82b4 MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check
https://bugzilla.tianocore.org/show_bug.cgi?id=767

The USB I/O Protocol function ControlTransfer() has a DataLength
parameter that specifies the size of the Data buffer.  The
UsbBusDxe module implements the USB I/O Protocol using the
services of the USB2 Host Controller Protocol.  The DataLength
parameter in the USB2 Host Controller Protocol ControlTransfer()
service is an IN OUT parameter so the number of bytes actually
transferred is returned.  Since the USB I/O Protocol
ControlTransfer() service can not return the number of bytes
actually transferred, the only option if the number of bytes
actually transferred is less than the number of bytes requested
is to return EFI_DEVICE_ERROR.

The change fixes an issue with a USB mass storage device that
responds with 0 bytes to the Get MAX LUN command.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-11-20 14:43:28 -08:00
..
ComponentName.c
UsbBus.c MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check 2017-11-20 14:43:28 -08:00
UsbBus.h
UsbBusDxe.inf
UsbBusDxe.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbBusDxeExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbDesc.c MdeModulePkg/UsbBusDxe: Fixed USB descriptor length check 2016-06-29 10:37:22 +08:00
UsbDesc.h
UsbEnumer.c MdeModulePkg/UsbBusDxe: log warning message at DEBUG_WARN level 2017-09-11 22:38:59 +02:00
UsbEnumer.h
UsbHub.c MdeModulePkg/UsbBusDxe: rebase to ARRAY_SIZE() 2016-10-27 11:10:55 +02:00
UsbHub.h
UsbUtility.c MdeModulePkg/UsbBus: Correct debug message 2017-06-02 12:59:28 +08:00
UsbUtility.h