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.115; helo=mga14.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 36E3D21B02845 for ; Wed, 27 Jun 2018 18:40:45 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2018 18:40:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,281,1526367600"; d="scan'208";a="70588276" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 27 Jun 2018 18:40:44 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 18:40:32 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 18:40:32 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 09:40:31 +0800 From: "Wu, Hao A" To: "edk2-devel@lists.01.org" CC: "Zeng, Star" , "Shi, Steven" , "Dong, Eric" Thread-Topic: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart Thread-Index: AQHUDoDKi+eSdd5or0qYwxWLmRGQgKR05L1w Date: Thu, 28 Jun 2018 01:40:30 +0000 Message-ID: References: <20180628013853.20948-1-hao.a.wu@intel.com> In-Reply-To: <20180628013853.20948-1-hao.a.wu@intel.com> 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: Thu, 28 Jun 2018 01:40:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 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 > '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 ++++----- > 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