On 02/26/20 00:43, Laszlo Ersek wrote: > On 02/25/20 10:39, Ard Biesheuvel wrote:
>> + Status = ShellOpenFileByName (Filename, &FileHandle, >> + EFI_FILE_MODE_READ, 0); >> + if (!EFI_ERROR (Status)) { >> + Status = CacheInitrdFile (FileHandle); >> + } >> + if (EFI_ERROR (Status)) { >> + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN >> (STR_GEN_FILE_OPEN_FAIL), >> + mLinuxInitrdShellCommandHiiHandle, L"initrd", Param); >> + ShellStatus = SHELL_NOT_FOUND; >> + } >> + ShellCloseFile (&FileHandle); > > (13) If ShellOpenFileByName() fails, it seems to set FileHandle to NULL. > > Can ShellCloseFile() cope with NULL? > > FWIW, its sole parameter is not marked OPTIONAL. I missed the extra indirection here for a minute, sorry about that; the question still remains whether ShellCloseFile() can cope with (*FileHandle) being NULL. Thanks Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54810): https://edk2.groups.io/g/devel/message/54810 Mute This Topic: https://groups.io/mt/71530296/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-