MdeModulePkg: Add extra RestoreTpl() call in DiskIo

Adds a call to RestoreTpl() in DiskIo2ReadWriteDisk(). While the current
implementation does not technically violate spec on raise/restore TPL,
this extra call ensures symmetry between RaiseTpl and RestoreTpl calls,
which makes analysis of TPL correctness simpler and permits certain
non-standard TPL usages that some platforms require.

Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com>
This commit is contained in:
Ken Lautner 2024-08-23 15:33:55 -07:00 committed by mergify[bot]
parent afba5358c8
commit b17ac09cc4

View File

@ -847,6 +847,7 @@ DiskIo2ReadWriteDisk (
DISK_IO_SUBTASK *Subtask;
DISK_IO2_TASK *Task;
EFI_TPL OldTpl;
EFI_TPL OldTpl1;
BOOLEAN Blocking;
BOOLEAN SubtaskBlocking;
LIST_ENTRY *SubtasksPtr;
@ -977,7 +978,7 @@ DiskIo2ReadWriteDisk (
}
}
gBS->RaiseTPL (TPL_NOTIFY);
OldTpl1 = gBS->RaiseTPL (TPL_NOTIFY);
//
// Remove all the remaining subtasks when failure.
@ -1012,6 +1013,7 @@ DiskIo2ReadWriteDisk (
FreePool (Task);
}
gBS->RestoreTPL (OldTpl1);
gBS->RestoreTPL (OldTpl);
return Status;