summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-01-06 00:55:38 +0000
committerjiaxinwu <jiaxinwu@Edk2>2016-01-06 00:55:38 +0000
commit8339166dd1d8a9b106ee2ee259e5d953d07c5b7c (patch)
tree5fa6febf5e89b481a60809737ec5278026078954
parentf79865264f58cc12e3ace3b83cbea1ee289a5e55 (diff)
downloadedk2-8339166dd1d8a9b106ee2ee259e5d953d07c5b7c.tar.gz
edk2-8339166dd1d8a9b106ee2ee259e5d953d07c5b7c.tar.bz2
edk2-8339166dd1d8a9b106ee2ee259e5d953d07c5b7c.zip
NetworkPkg: Removing or adding some ASSERT statement
Refine the code by removing or adding some ASSERT statement to make the code more readable. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19592 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.c4
-rw-r--r--NetworkPkg/DnsDxe/DnsProtocol.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c
index 8725670a8e..823bcf3792 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.c
+++ b/NetworkPkg/DnsDxe/DnsImpl.c
@@ -1360,8 +1360,6 @@ ParseDnsResponse (
// Check whether it's the GeneralLookUp querying.
//
if (Instance->Service->IpVersion == IP_VERSION_4 && Dns4TokenEntry->GeneralLookUp) {
- ASSERT (Dns4TokenEntry != NULL);
-
Dns4RR = Dns4TokenEntry->Token->RspData.GLookupData->RRList;
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);
@@ -1387,8 +1385,6 @@ ParseDnsResponse (
RRCount ++;
} else if (Instance->Service->IpVersion == IP_VERSION_6 && Dns6TokenEntry->GeneralLookUp) {
- ASSERT (Dns6TokenEntry != NULL);
-
Dns6RR = Dns6TokenEntry->Token->RspData.GLookupData->RRList;
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);
diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c
index e7aa227994..a3f3de9766 100644
--- a/NetworkPkg/DnsDxe/DnsProtocol.c
+++ b/NetworkPkg/DnsDxe/DnsProtocol.c
@@ -462,6 +462,8 @@ Dns4HostNameToIp (
goto ON_EXIT;
}
+ ASSERT (Packet != NULL);
+
//
// Save the token into the Dns4TxTokens map.
//
@@ -635,6 +637,8 @@ Dns4GeneralLookUp (
goto ON_EXIT;
}
+ ASSERT (Packet != NULL);
+
//
// Save the token into the Dns4TxTokens map.
//
@@ -1231,6 +1235,8 @@ Dns6HostNameToIp (
goto ON_EXIT;
}
+ ASSERT (Packet != NULL);
+
//
// Save the token into the Dns6TxTokens map.
//
@@ -1404,6 +1410,8 @@ Dns6GeneralLookUp (
goto ON_EXIT;
}
+ ASSERT (Packet != NULL);
+
//
// Save the token into the Dns6TxTokens map.
//