From c87ac38cf280fa969f1033de3c5b7a157aac8cbc Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Mon, 29 Oct 2018 11:54:45 +0800 Subject: [PATCH] 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 Reviewed-by: Star Zeng --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 1 + 1 file changed, 1 insertion(+) 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)) {