ArmJunoDxe/InstallFdt.c: Fix the closing of the simple file system protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16584 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ronald Cron 2015-01-06 15:48:19 +00:00 committed by oliviermartin
parent 8a8641b564
commit f38d0dfbef
1 changed files with 8 additions and 8 deletions

View File

@ -174,14 +174,14 @@ JunoFdtStart (
Status = BootMonFs->OpenVolume (BootMonFs, &Fs); Status = BootMonFs->OpenVolume (BootMonFs, &Fs);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
PrintMessage ("Warning: Fail to open file system that should contain FDT file.\n"); PrintMessage ("Warning: Fail to open file system that should contain FDT file.\n");
goto UNLOAD_PROTOCOL; goto CLOSE_PROTOCOL;
} }
File = NULL; File = NULL;
Status = Fs->Open (Fs, &File, mFdtFileName, EFI_FILE_MODE_READ, 0); Status = Fs->Open (Fs, &File, mFdtFileName, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
PrintMessage ("Warning: Fail to load FDT file '%s'.\n", mFdtFileName); PrintMessage ("Warning: Fail to load FDT file '%s'.\n", mFdtFileName);
goto UNLOAD_PROTOCOL; goto CLOSE_PROTOCOL;
} }
Size = 0; Size = 0;
@ -189,7 +189,7 @@ JunoFdtStart (
FileInfo = AllocatePool (Size); FileInfo = AllocatePool (Size);
Status = File->GetInfo (File, &gEfiFileInfoGuid, &Size, FileInfo); Status = File->GetInfo (File, &gEfiFileInfoGuid, &Size, FileInfo);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto UNLOAD_PROTOCOL; goto CLOSE_PROTOCOL;
} }
// Get the file size // Get the file size
@ -219,12 +219,12 @@ JunoFdtStart (
} }
} }
UNLOAD_PROTOCOL: CLOSE_PROTOCOL:
// We do not need the FileSystem protocol // We do not need the FileSystem protocol
gBS->CloseProtocol ( gBS->CloseProtocol (
ControllerHandle, ControllerHandle,
&gEfiSimpleFileSystemProtocolGuid, &gEfiSimpleFileSystemProtocolGuid,
DriverBinding->ImageHandle, gImageHandle,
ControllerHandle); ControllerHandle);
return Status; return Status;