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.136; helo=mga12.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 802F5203369C6 for ; Fri, 29 Jun 2018 01:46:06 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 01:46:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="68301807" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 29 Jun 2018 01:46:02 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Jun 2018 01:46:02 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Jun 2018 01:46:01 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.223]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Fri, 29 Jun 2018 16:46:00 +0800 From: "Zeng, Star" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Shi, Steven" , "Dong, Eric" , "Zeng, Star" Thread-Topic: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart Thread-Index: AQHUDoDKjJS3kgOUckmTfiyZ8x3ks6R0XuAAgAKPGtA= Date: Fri, 29 Jun 2018 08:45:59 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB5FBD8@shsmsx102.ccr.corp.intel.com> References: <20180628013853.20948-1-hao.a.wu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 08:46:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Wu, Hao A=20 Sent: Thursday, June 28, 2018 9:41 AM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Shi, Steven ; D= ong, Eric Subject: RE: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr chec= k in BindingStart Correction: Should be V1 of the patch. Best Regards, Hao Wu > -----Original Message----- > From: Wu, Hao A > Sent: Thursday, June 28, 2018 9:39 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A; Zeng, Star; Shi, Steven; Dong, Eric > Subject: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr=20 > check in BindingStart >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D916 >=20 > Within function AtaAtapiPassThruStart(): > Add missing NULL pointer check for variable 'Instance' under the=20 > 'ErrorExit' code logics. >=20 > Cc: Star Zeng > Cc: Steven Shi > Cc: Eric Dong > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hao Wu > --- > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 9=20 > ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > index aab704bcd3..4108bafd85 100644 > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > @@ -827,12 +827,11 @@ ErrorExit: > gBS->CloseEvent (Instance->TimerEvent); > } >=20 > - // > - // Remove all inserted ATA devices. > - // > - DestroyDeviceInfoList(Instance); > - > if (Instance !=3D NULL) { > + // > + // Remove all inserted ATA devices. > + // > + DestroyDeviceInfoList (Instance); > FreePool (Instance); > } > return EFI_UNSUPPORTED; > -- > 2.12.0.windows.1