From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B560921167442 for ; Sun, 28 Oct 2018 21:40:53 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2018 21:40:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,438,1534834800"; d="scan'208";a="104083398" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 28 Oct 2018 21:40:52 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 28 Oct 2018 21:40:52 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 28 Oct 2018 21:40:52 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.84]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.102]) with mapi id 14.03.0415.000; Mon, 29 Oct 2018 12:40:49 +0800 From: "Zeng, Star" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/UsbBusDxe: Add missing "return NULL" in UsbCreateDesc() Thread-Index: AQHUbzsUutAvoIgB3kOVMP2w4DOUl6U1o5jw Date: Mon, 29 Oct 2018 04:40:49 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BC5C8C9@shsmsx102.ccr.corp.intel.com> References: <20181029035534.334928-1-ruiyu.ni@intel.com> In-Reply-To: <20181029035534.334928-1-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFiNjk4OTMtMTc1OC00ZGFiLWFmM2QtMzA2ZTkwMWIxZjcxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiK0Z1XC9ZRWVxMDhwbm15UGpWek1oSERuYzZOUFZ5MnVsTldEeHhiRWtxYTQrR3RVUm1tcnIyejF0YXh2YXUyQWsifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/UsbBusDxe: Add missing "return NULL" in UsbCreateDesc() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 04:40:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Ni, Ruiyu=20 Sent: Monday, October 29, 2018 11:56 AM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [PATCH] MdeModulePkg/UsbBusDxe: Add missing "return NULL" in UsbCr= eateDesc() When (Len < Offset) is TRUE, indicating the data to visit is beyond the bou= ndary, 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 Cc: 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/Us= b/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 =3D %d/%d!\n", Offset, Len)); + return NULL; } =20 if ((Head->Type !=3D Type) || (Head->Len < DescLen)) { -- 2.16.1.windows.1