summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-02 05:50:45 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-02 05:50:45 +0000
commitaf58e377315ae4acb5cd2c960daa26ab2746d9e9 (patch)
tree38f903ac634f82a2511f1b1defc67fbd201b30bd /MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
parent6041576eb242d55cdc80115605ee3f1132729ad1 (diff)
downloadedk2-af58e377315ae4acb5cd2c960daa26ab2746d9e9.tar.gz
edk2-af58e377315ae4acb5cd2c960daa26ab2746d9e9.tar.bz2
edk2-af58e377315ae4acb5cd2c960daa26ab2746d9e9.zip
add parameter check logic to clean up Klocwork warning.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7390 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c')
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index 26f13dbfd0..568720d3ef 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -633,6 +633,7 @@ Uhci2ControlTransfer (
UINT8 *DataPhy;
VOID *DataMap;
BOOLEAN IsSlowDevice;
+ UINTN TransferDataLength;
Uhc = UHC_FROM_USB2_HC_PROTO (This);
TDs = NULL;
@@ -660,10 +661,16 @@ Uhci2ControlTransfer (
return EFI_INVALID_PARAMETER;
}
- if ((TransferDirection != EfiUsbNoData) && (DataLength == NULL)) {
+ if ((TransferDirection != EfiUsbNoData) && (Data == NULL || DataLength == NULL)) {
return EFI_INVALID_PARAMETER;
}
+ if (TransferDirection == EfiUsbNoData) {
+ TransferDataLength = 0;
+ } else {
+ TransferDataLength = *DataLength;
+ }
+
*TransferResult = EFI_USB_ERR_SYSTEM;
Status = EFI_DEVICE_ERROR;
@@ -702,7 +709,7 @@ Uhci2ControlTransfer (
PktId,
RequestPhy,
DataPhy,
- *DataLength,
+ TransferDataLength,
(UINT8) MaximumPacketLength,
IsSlowDevice
);