X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FUdp6Dxe%2FUdp6Main.c;h=71684bc285aa08453836d1148eec26fdd09d3ff1;hb=f75a7f568e6d0944327970b3f3f2dafd9bba76b1;hp=f3e99255f953cd6aeee284ed6994739df529143d;hpb=d551cc64cdf1f943744294819220b78a60b10822;p=mirror_edk2.git
diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c
index f3e99255f9..71684bc285 100644
--- a/NetworkPkg/Udp6Dxe/Udp6Main.c
+++ b/NetworkPkg/Udp6Dxe/Udp6Main.c
@@ -1,7 +1,7 @@
/** @file
Contains all EFI_UDP6_PROTOCOL interfaces.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -284,7 +284,7 @@ Udp6Configure (
ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
}
-
+
ON_EXIT:
gBS->RestoreTPL (OldTpl);
@@ -351,6 +351,9 @@ Udp6Groups (
Instance = UDP6_INSTANCE_DATA_FROM_THIS (This);
if (!Instance->Configured) {
+ if (McastIp != NULL) {
+ FreePool (McastIp);
+ }
return EFI_NOT_STARTED;
}
@@ -378,7 +381,10 @@ Udp6Groups (
Status = NetMapInsertTail (&Instance->McastIps, (VOID *) McastIp, NULL);
} else {
- NetMapIterate (&Instance->McastIps, Udp6LeaveGroup, MulticastAddress);
+ Status = NetMapIterate (&Instance->McastIps, Udp6LeaveGroup, MulticastAddress);
+ if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {
+ Status = EFI_SUCCESS;
+ }
}
ON_EXIT:
@@ -525,6 +531,11 @@ Udp6Transmit (
Udp6Header = (EFI_UDP_HEADER *) NetbufAllocSpace (Packet, UDP6_HEADER_SIZE, TRUE);
ASSERT (Udp6Header != NULL);
+ if (Udp6Header == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto ON_EXIT;
+ }
+
ConfigData = &Instance->ConfigData;
//
@@ -577,7 +588,7 @@ Udp6Transmit (
//
// If the calculated checksum is 0, fill the Checksum field with all ones.
//
- Udp6Header->Checksum = 0XFFFF;
+ Udp6Header->Checksum = 0xffff;
}
} else {
//