summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-10-29 11:54:45 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-10-30 09:17:40 +0800
commitc87ac38cf280fa969f1033de3c5b7a157aac8cbc (patch)
tree11fb1a0aeb7a9fd6eaaebb7a7e6f2cdad161ad68 /MdeModulePkg
parentc09b254bdc6050cc8b580a26558f692f958645d6 (diff)
downloadedk2-c87ac38cf280fa969f1033de3c5b7a157aac8cbc.tar.gz
edk2-c87ac38cf280fa969f1033de3c5b7a157aac8cbc.tar.bz2
edk2-c87ac38cf280fa969f1033de3c5b7a157aac8cbc.zip
MdeModulePkg/UsbBusDxe: Add missing "return NULL" in UsbCreateDesc()
When (Len < Offset) is TRUE, indicating the data to visit is beyond the boundary, the error message is printed but the function doesn't return NULL. It's a typo when modifying the commit 4c034bf62. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
index 7ff31bb656..d286c81327 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
@@ -229,6 +229,7 @@ UsbCreateDesc (
//
if (Len < Offset) {
DEBUG ((DEBUG_ERROR, "UsbCreateDesc: met mal-format descriptor, Offset/Len = %d/%d!\n", Offset, Len));
+ return NULL;
}
if ((Head->Type != Type) || (Head->Len < DescLen)) {