public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, sergei@posteo.net
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jordan Justen <jordan.l.justen@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 2/2] OvmfPkg/VirtioFsDxe: suppress incorrect gcc warnings
Date: Fri, 14 May 2021 11:29:01 +0200	[thread overview]
Message-ID: <1137711f-ef3a-5421-9892-56e13b6c8b6b@redhat.com> (raw)
In-Reply-To: <20210511225616.5942-3-sergei@posteo.net>

On 05/12/21 00:56, Sergei Dmitrouk wrote:
> `CreateDirectoryIfCreating` is used only if `PermitCreation` is set.
> 
> `NewNodeIsDirectory` might not set in case of error, but that would lead
> to leaving the function before invalid use.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3228
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Signed-off-by: Sergei Dmitrouk <sergei@posteo.net>
> ---
>  OvmfPkg/VirtioFsDxe/SimpleFsOpen.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> index d73d23fe8665..9e46e8ab8385 100644
> --- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> +++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> @@ -332,6 +332,12 @@ VirtioFsSimpleFileOpen (
>      return EFI_INVALID_PARAMETER;
>    }
>  
> +  //
> +  // Set CreateDirectoryIfCreating to suppress incorrect compiler/analyzer
> +  // warnings.
> +  //
> +  CreateDirectoryIfCreating = FALSE;
> +
>    //
>    // Validate the Attributes requested for the case when the file ends up being
>    // created, provided creation is permitted.
> @@ -426,6 +432,11 @@ VirtioFsSimpleFileOpen (
>      goto FreeNewCanonicalPath;
>    }
>  
> +  //
> +  // Set NewNodeIsDirectory to suppress incorrect compiler/analyzer warnings.
> +  //
> +  NewNodeIsDirectory = FALSE;
> +
>    //
>    // Try to open LastComponent directly under DirNodeId, as an existent regular
>    // file or directory.
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


  reply	other threads:[~2021-05-14  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 22:56 [PATCH v1 0/2] "maybe-uninitialized" warnings emitted by sergei
2021-05-11 22:56 ` [PATCH v1 1/2] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning Sergei Dmitrouk
2021-05-14  9:19   ` [edk2-devel] " Laszlo Ersek
2021-05-11 22:56 ` [PATCH v1 2/2] OvmfPkg/VirtioFsDxe: suppress incorrect gcc warnings Sergei Dmitrouk
2021-05-14  9:29   ` Laszlo Ersek [this message]
2021-05-14 10:01 ` [edk2-devel] [PATCH v1 0/2] "maybe-uninitialized" warnings emitted by 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=1137711f-ef3a-5421-9892-56e13b6c8b6b@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