Skip to content

Commit 0d12945

Browse files
os-dmergify[bot]
authored andcommitted
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>
1 parent f3bc601 commit 0d12945

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

NetworkPkg/Ip6Dxe/Ip6Impl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ EfiIp6GetModeData (
6161
return EFI_INVALID_PARAMETER;
6262
}
6363

64-
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
6564
IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);
6665
IpSb = IpInstance->Service;
6766
IpIf = IpInstance->Interface;
@@ -70,6 +69,8 @@ EfiIp6GetModeData (
7069
return EFI_INVALID_PARAMETER;
7170
}
7271

72+
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
73+
7374
if (Ip6ModeData != NULL) {
7475
//
7576
// IsStarted is "whether the EfiIp6Configure has been called".

NetworkPkg/SnpDxe/Get_status.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ SnpUndi32GetStatus (
216216

217217
Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
218218

219-
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
220-
221219
if (Snp == NULL) {
222220
return EFI_DEVICE_ERROR;
223221
}
224222

223+
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
224+
225225
switch (Snp->Mode.State) {
226226
case EfiSimpleNetworkInitialized:
227227
break;

NetworkPkg/SnpDxe/Transmit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ SnpUndi32Transmit (
287287

288288
Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
289289

290-
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
291-
292290
if (Snp == NULL) {
293291
return EFI_DEVICE_ERROR;
294292
}
295293

294+
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
295+
296296
switch (Snp->Mode.State) {
297297
case EfiSimpleNetworkInitialized:
298298
break;

0 commit comments

Comments
 (0)