]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UsbBusDxe: Add missing "return NULL" in UsbCreateDesc()
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 29 Oct 2018 03:54:45 +0000 (11:54 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 30 Oct 2018 01:17:40 +0000 (09:17 +0800)
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>
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c

index 7ff31bb656817b19a981636e29adc805bef16c3d..d286c81327b4b13ec54df7907f5ddae50207470f 100644 (file)
@@ -229,6 +229,7 @@ UsbCreateDesc (
   //\r
   if (Len < Offset) {\r
     DEBUG ((DEBUG_ERROR, "UsbCreateDesc: met mal-format descriptor, Offset/Len = %d/%d!\n", Offset, Len));\r
+    return NULL;\r
   }\r
 \r
   if ((Head->Type != Type) || (Head->Len < DescLen)) {\r