public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, newexplorerj@gmail.com
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Bus: Potential NULL pointer on Token
Date: Fri, 21 Feb 2020 17:22:28 +0100	[thread overview]
Message-ID: <26c33efe-faf7-8f66-1842-450c5b3ad6a4@redhat.com> (raw)
In-Reply-To: <4ed94d8e2d027528621074754169fbcb9bea0a22.1582261089.git.newexplorerj@gmail.com>

On 02/21/20 07:00, GuoMinJ wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2286
> 
> Token pointer may be NULL, it is should be check before use it.
> 
> Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
> ---
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> index 9f42abe7e2..25ab5abb2d 100644
> --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
> @@ -1367,7 +1367,12 @@ SdEraseBlocks (
>      return Status;
>    }
>  
> -  DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", Lba, BlockNum, Token->Event, Status));
> +  DEBUG ((DEBUG_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x with %r, ", Lba, BlockNum, Status));
> +  if ((Token != NULL) && (Token->Event != NULL)) {
> +    DEBUG ((DEBUG_ERROR, "Event pointer is %p\n", Token->Event));
> +  else {
> +    DEBUG ((DEBUG_ERROR, "Event is meaningless\n"));
> +  }
>  
>    return Status;
>  }
> 

Please update the subject line; it should say "SdDxe" somewhere.

Thanks
Laszlo


      reply	other threads:[~2020-02-21 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  6:00 [PATCH] MdeModulePkg/Bus: Potential NULL pointer on Token GuoMinJ
2020-02-21 16:22 ` Laszlo Ersek [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=26c33efe-faf7-8f66-1842-450c5b3ad6a4@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