From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1AE721A1E3C for ; Mon, 17 Oct 2016 02:07:58 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 17 Oct 2016 02:07:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,357,1473145200"; d="scan'208";a="20311728" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2016 02:07:57 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 17 Oct 2016 02:06:14 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 17 Oct 2016 02:06:14 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0248.002; Mon, 17 Oct 2016 17:06:12 +0800 From: "Fu, Siyuan" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wu, Jiaxin" Thread-Topic: [patch] NetworkPkg: Enhance the code in DNS driver. Thread-Index: AQHSJefYn0djeOS40UahZF7spYAKM6CsX4Jg Date: Mon, 17 Oct 2016 09:06:11 +0000 Message-ID: References: <1476428061-23960-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1476428061-23960-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzQ3Yzg4ZDctYTYwZS00YTllLWIxZTktZDZlMjQyMDE5YzNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpQN2xIY0h4TjNDWjRza2xKSVVVTHROVGpaUHlNQmpXSFB5ZjN0QUpQWWM9In0= x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] NetworkPkg: Enhance the code in DNS driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 09:07:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan siyuan.fu@intel.com > -----Original Message----- > From: Zhang, Lubo > Sent: Friday, October 14, 2016 2:54 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [patch] NetworkPkg: Enhance the code in DNS driver. >=20 > There may be an error happens when we use the > configure function to set or change the configuration > data for the DNS6 instance, So we will free the > DnsServerList without configured to NULL. If we reset > the instance with the parameter DnsConfigData to NULL, the > DnsServerList will be freed twice. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Ye Ting > Cc: Fu Siyuan > Cc: Wu Jiaxin > --- > NetworkPkg/DnsDxe/DnsProtocol.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c > b/NetworkPkg/DnsDxe/DnsProtocol.c > index 64fca6a..6d117b2 100644 > --- a/NetworkPkg/DnsDxe/DnsProtocol.c > +++ b/NetworkPkg/DnsDxe/DnsProtocol.c > @@ -285,10 +285,11 @@ Dns4Configure ( > // > Status =3D Dns4ConfigUdp (Instance, Instance->UdpIo); > if (EFI_ERROR (Status)) { > if (Instance->Dns4CfgData.DnsServerList !=3D NULL) { > FreePool (Instance->Dns4CfgData.DnsServerList); > + Instance->Dns4CfgData.DnsServerList =3D NULL; > } > goto ON_EXIT; > } >=20 > // > @@ -296,10 +297,11 @@ Dns4Configure ( > // > Status =3D AddDns4ServerIp (&mDriverData->Dns4ServerList, Instance- > >SessionDnsServer.v4); > if (EFI_ERROR (Status)) { > if (Instance->Dns4CfgData.DnsServerList !=3D NULL) { > FreePool (Instance->Dns4CfgData.DnsServerList); > + Instance->Dns4CfgData.DnsServerList =3D NULL; > } > goto ON_EXIT; > } >=20 > Instance->State =3D DNS_STATE_CONFIGED; > @@ -1106,10 +1108,11 @@ Dns6Configure ( > // > Status =3D Dns6ConfigUdp (Instance, Instance->UdpIo); > if (EFI_ERROR (Status)) { > if (Instance->Dns6CfgData.DnsServerList !=3D NULL) { > FreePool (Instance->Dns6CfgData.DnsServerList); > + Instance->Dns6CfgData.DnsServerList =3D NULL; > } > goto ON_EXIT; > } >=20 > // > @@ -1117,10 +1120,11 @@ Dns6Configure ( > // > Status =3D AddDns6ServerIp (&mDriverData->Dns6ServerList, Instance- > >SessionDnsServer.v6); > if (EFI_ERROR (Status)) { > if (Instance->Dns6CfgData.DnsServerList !=3D NULL) { > FreePool (Instance->Dns6CfgData.DnsServerList); > + Instance->Dns6CfgData.DnsServerList =3D NULL; > } > goto ON_EXIT; > } >=20 > Instance->State =3D DNS_STATE_CONFIGED; > -- > 1.9.5.msysgit.1