summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2024-10-08 10:12:29 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-11-22 19:45:03 +0000
commit0d129450c2c436e047f8ee929db63224e643cc30 (patch)
treedce2715f32f42f6e1f82586856689c7a28f4900f /NetworkPkg
parentf3bc6013d2262b1a40898e5940c5e5dc000724df (diff)
downloadedk2-0d129450c2c436e047f8ee929db63224e643cc30.tar.gz
NetworkPkg: Restore TPL Before Return
This patch fixes a few instances of error cases in NetworkPkg returning after a RaiseTPL call without restoring the TPL first. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Impl.c3
-rw-r--r--NetworkPkg/SnpDxe/Get_status.c4
-rw-r--r--NetworkPkg/SnpDxe/Transmit.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Impl.c b/NetworkPkg/Ip6Dxe/Ip6Impl.c
index a4bfd0f9a3..5fbb81cd2a 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Impl.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Impl.c
@@ -61,7 +61,6 @@ EfiIp6GetModeData (
return EFI_INVALID_PARAMETER;
}
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);
IpSb = IpInstance->Service;
IpIf = IpInstance->Interface;
@@ -70,6 +69,8 @@ EfiIp6GetModeData (
return EFI_INVALID_PARAMETER;
}
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+
if (Ip6ModeData != NULL) {
//
// IsStarted is "whether the EfiIp6Configure has been called".
diff --git a/NetworkPkg/SnpDxe/Get_status.c b/NetworkPkg/SnpDxe/Get_status.c
index 14b678fd36..2097fbcbaa 100644
--- a/NetworkPkg/SnpDxe/Get_status.c
+++ b/NetworkPkg/SnpDxe/Get_status.c
@@ -216,12 +216,12 @@ SnpUndi32GetStatus (
Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
-
if (Snp == NULL) {
return EFI_DEVICE_ERROR;
}
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+
switch (Snp->Mode.State) {
case EfiSimpleNetworkInitialized:
break;
diff --git a/NetworkPkg/SnpDxe/Transmit.c b/NetworkPkg/SnpDxe/Transmit.c
index e2c7467b86..7947cde436 100644
--- a/NetworkPkg/SnpDxe/Transmit.c
+++ b/NetworkPkg/SnpDxe/Transmit.c
@@ -287,12 +287,12 @@ SnpUndi32Transmit (
Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
-
if (Snp == NULL) {
return EFI_DEVICE_ERROR;
}
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+
switch (Snp->Mode.State) {
case EfiSimpleNetworkInitialized:
break;