public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Jeremy Linton <jeremy.linton@arm.com>,
	 "Liming Gao (Byosoft address)" <gaoliming@byosoft.com.cn>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Peter Batard <pete@akeo.ie>,
	 Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <leif@nuviainc.com>,
	 Andrei Warkentin <awarkentin@vmware.com>,
	Sunny Wang <Sunny.Wang@arm.com>,
	 Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Subject: Re: [PATCH] EmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map field
Date: Mon, 16 Aug 2021 09:10:33 +0200	[thread overview]
Message-ID: <CAMj1kXE+BUhOn0LANoUG9q3KZ8-aaJc7dOk-TVh3+zcgRcib-w@mail.gmail.com> (raw)
In-Reply-To: <20210813050508.28232-1-jeremy.linton@arm.com>

On Fri, 13 Aug 2021 at 07:05, Jeremy Linton <jeremy.linton@arm.com> wrote:
>
> Map->Operation is used to select whether a DMA region that
> is being bounced has the source buffer copied to it. Except
> Map->Operation isn't yet set, so the behavior is somewhat
> random. Instead use the passed in Operation parameter.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Thanks for fixing this.

Liming, I am not sure what stage of the release cycle we are currently
in, but this fix should go in right away anyway. Unless any objections
are raised, I will merge it later today. I will leave it to you to
decide how this affects the stable tag release schedule.

-- 
Ard.


> ---
>  EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> index 9c8ef5bfb5..1aec86fffd 100644
> --- a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> +++ b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> @@ -224,7 +224,7 @@ DmaMap (
>        goto FreeMapInfo;
>      }
>
> -    if (Map->Operation == MapOperationBusMasterRead) {
> +    if (Operation == MapOperationBusMasterRead) {
>        CopyMem (Map->BufferAddress, (VOID *)(UINTN)HostAddress, *NumberOfBytes);
>      }
>      mCpu->FlushDataCache (mCpu, (UINTN)Map->BufferAddress, AllocSize,
> --
> 2.13.7
>

  reply	other threads:[~2021-08-16  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  5:05 [PATCH] EmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map field Jeremy Linton
2021-08-16  7:10 ` Ard Biesheuvel [this message]
2021-08-17 14:02   ` Ard Biesheuvel

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=CAMj1kXE+BUhOn0LANoUG9q3KZ8-aaJc7dOk-TVh3+zcgRcib-w@mail.gmail.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