]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Removing or adding some ASSERT statement
authorJiaxin Wu <jiaxin.wu@intel.com>
Wed, 6 Jan 2016 00:55:38 +0000 (00:55 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Wed, 6 Jan 2016 00:55:38 +0000 (00:55 +0000)
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

NetworkPkg/DnsDxe/DnsImpl.c
NetworkPkg/DnsDxe/DnsProtocol.c

index 8725670a8e8a4a51c098dcd7b1e61f067039c021..823bcf379295a531e6f9d4cc7cf422e1e67e006d 100644 (file)
@@ -1360,8 +1360,6 @@ ParseDnsResponse (
     // Check whether it's the GeneralLookUp querying.\r
     //\r
     if (Instance->Service->IpVersion == IP_VERSION_4 && Dns4TokenEntry->GeneralLookUp) {\r
-      ASSERT (Dns4TokenEntry != NULL);\r
-      \r
       Dns4RR = Dns4TokenEntry->Token->RspData.GLookupData->RRList;\r
       AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
 \r
@@ -1387,8 +1385,6 @@ ParseDnsResponse (
       \r
       RRCount ++;\r
     } else if (Instance->Service->IpVersion == IP_VERSION_6 && Dns6TokenEntry->GeneralLookUp) {\r
-      ASSERT (Dns6TokenEntry != NULL);\r
-      \r
       Dns6RR = Dns6TokenEntry->Token->RspData.GLookupData->RRList;\r
       AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
 \r
index e7aa227994ed8adc2ec68be46fa427368a13d84e..a3f3de9766197c5a9464a0289997d520a41a3946 100644 (file)
@@ -462,6 +462,8 @@ Dns4HostNameToIp (
     goto ON_EXIT;\r
   }\r
 \r
+  ASSERT (Packet != NULL);\r
+\r
   //\r
   // Save the token into the Dns4TxTokens map.\r
   //\r
@@ -635,6 +637,8 @@ Dns4GeneralLookUp (
     goto ON_EXIT;\r
   }\r
 \r
+  ASSERT (Packet != NULL);\r
+\r
   //\r
   // Save the token into the Dns4TxTokens map.\r
   //\r
@@ -1231,6 +1235,8 @@ Dns6HostNameToIp (
     goto ON_EXIT;\r
   }\r
 \r
+  ASSERT (Packet != NULL);\r
+\r
   //\r
   // Save the token into the Dns6TxTokens map.\r
   //\r
@@ -1404,6 +1410,8 @@ Dns6GeneralLookUp (
     goto ON_EXIT;\r
   }\r
 \r
+  ASSERT (Packet != NULL);\r
+\r
   //\r
   // Save the token into the Dns6TxTokens map.\r
   //\r