FatPkg: Corrects FatDelete exit logic if PcdFatReadOnlyMode is set

The FatDelete routine closes the file even it write protected

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
This commit is contained in:
Savva Mitrofanov 2023-02-28 18:37:36 +06:00
parent 18722f129f
commit 7052c3badf
No known key found for this signature in database
GPG Key ID: 774924031750BF64

View File

@ -31,10 +31,6 @@ FatDelete (
EFI_STATUS Status;
UINTN Round;
if (FeaturePcdGet (PcdFatReadOnlyMode)) {
return EFI_WRITE_PROTECTED;
}
IFile = IFILE_FROM_FHAND (FHand);
OFile = IFile->OFile;
@ -48,7 +44,7 @@ FatDelete (
//
// If the file is read-only, then don't delete it
//
if (IFile->ReadOnly) {
if (IFile->ReadOnly || FeaturePcdGet (PcdFatReadOnlyMode)) {
Status = EFI_WRITE_PROTECTED;
goto Done;
}