From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 E8E5620347118 for ; Sun, 19 Nov 2017 23:28:39 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2017 23:32:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,425,1505804400"; d="scan'208";a="151357047" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.23]) by orsmga004.jf.intel.com with ESMTP; 19 Nov 2017 23:32:51 -0800 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Hao Wu , Jiewen Yao Date: Mon, 20 Nov 2017 15:32:49 +0800 Message-Id: <1511163169-9172-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH] MdeModulePkg EhciPei: Also check Buf against NULL to return error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 07:28:40 -0000 Cc: Hao Wu Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index 606a53db1da1..6b19362699b1 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c @@ -134,7 +134,7 @@ EhcInitSched ( &Map ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) || (Buf == NULL)) { return EFI_OUT_OF_RESOURCES; } -- 2.7.0.windows.1