public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Jeff Brasen <jbrasen@nvidia.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH v2] MdeModulePkg/SdDxe: Fix potential NULL pointer access
Date: Mon, 19 Nov 2018 01:11:40 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C84DA89@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <554d7bd5193cec18f844e31a9dd598b3c6c7dae2.1542355760.git.jbrasen@nvidia.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff
> Brasen
> Sent: Friday, November 16, 2018 4:10 PM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen
> Subject: [edk2] [PATCH v2] MdeModulePkg/SdDxe: Fix potential NULL pointer
> access
> 
> SdReadWrite can be called with a NULL Token for synchronous operations.
> Add guard for DEBUG print to only print event pointer with Token is not
> NULL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>

Thanks.

Reviewed-by: Hao Wu <hao.a.wu@intel.com> and pushed at
5a16ba3ae18e6528cb83039951e15a4b76004949

Best Regards,
Hao Wu

> ---
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> index b8d115a..a4695ff 100644
> --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> @@ -670,8 +670,9 @@ SdReadWrite (
>      if (EFI_ERROR (Status)) {
>        return Status;
>      }
> -    DEBUG ((DEBUG_BLKIO, "Sd%a(): Lba 0x%x BlkNo 0x%x Event %p with %r\n",
> IsRead ? "Read" : "Write", Lba, BlockNum, Token->Event, Status));
> -
> +    DEBUG ((DEBUG_BLKIO, "Sd%a(): Lba 0x%x BlkNo 0x%x Event %p
> with %r\n",
> +      IsRead ? "Read" : "Write", Lba, BlockNum,
> +      (Token != NULL) ? Token->Event : NULL, Status));
>      Lba   += BlockNum;
>      Buffer = (UINT8*)Buffer + BufferSize;
>      Remaining -= BlockNum;
> --
> 2.7.4
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-11-19  1:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16  8:09 [PATCH v2] MdeModulePkg/SdDxe: Fix potential NULL pointer access Jeff Brasen
2018-11-19  1:11 ` Wu, Hao A [this message]

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=B80AF82E9BFB8E4FBD8C89DA810C6A093C84DA89@SHSMSX104.ccr.corp.intel.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