From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ard.biesheuvel@linaro.org
Cc: leif@nuviainc.com, pjones@redhat.com, mjg59@google.com,
agraf@csgraf.de, daniel.kiper@oracle.com,
michael.d.kinney@intel.com, jian.j.wang@intel.com,
hao.a.wu@intel.com, ray.ni@intel.com, zhichao.gao@intel.com
Subject: Re: [edk2-devel] [PATCH v2 2/6] OvmfPkg: add 'initrd' shell command to expose Linux initrd via device path
Date: Wed, 26 Feb 2020 01:00:01 +0100 [thread overview]
Message-ID: <4c035460-20c2-11b3-5d41-05f896af4c34@redhat.com> (raw)
In-Reply-To: <2192beca-d8af-beae-cf72-ba63ad0883f7@redhat.com>
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
next prev parent reply other threads:[~2020-02-26 0:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 9:39 [PATCH v2 0/6] OvmfPkg: implement initrd shell command and mixed mode loader Ard Biesheuvel
2020-02-25 9:39 ` [PATCH v2 1/6] OvmfPkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID Ard Biesheuvel
2020-02-25 22:14 ` [edk2-devel] " Laszlo Ersek
2020-02-25 9:39 ` [PATCH v2 2/6] OvmfPkg: add 'initrd' shell command to expose Linux initrd via device path Ard Biesheuvel
2020-02-25 23:43 ` [edk2-devel] " Laszlo Ersek
2020-02-26 0:00 ` Laszlo Ersek [this message]
2020-02-26 1:25 ` Laszlo Ersek
2020-02-25 9:39 ` [PATCH v2 3/6] ArmVirtPkg: add the 'initrd' dynamic shell command Ard Biesheuvel
2020-02-25 23:46 ` [edk2-devel] " Laszlo Ersek
2020-02-25 9:39 ` [PATCH v2 4/6] OvmfPkg: " Ard Biesheuvel
2020-02-25 23:48 ` [edk2-devel] " Laszlo Ersek
2020-02-25 9:39 ` [PATCH v2 5/6] MdeModulePkg/DxeCore: defer PE/COFF emulator registration to StartImage Ard Biesheuvel
2020-02-25 9:39 ` [PATCH v2 6/6] OvmfPkg IA32: add support for loading X64 images Ard Biesheuvel
2020-02-25 23:55 ` [edk2-devel] " Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c035460-20c2-11b3-5d41-05f896af4c34@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox