public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3] MdeModulePkg/SdDxe: Check the Token to avoid null pointer
@ 2020-03-26  6:42 Guomin Jiang
  2020-03-26  6:51 ` [edk2-devel] " Wu, Hao A
  0 siblings, 1 reply; 3+ messages in thread
From: Guomin Jiang @ 2020-03-26  6:42 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2286

Token pointer may be NULL, it should be checked before use it.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
index 9f42abe7e2..721f264377 100644
--- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
+++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
@@ -1367,7 +1367,14 @@ 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_INFO,
+    "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n",
+    Lba,
+    BlockNum,
+    (Token != NULL) ? Token->Event : NULL,
+    Status
+    ));
 
   return Status;
 }
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-27  1:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-26  6:42 [PATCH v3] MdeModulePkg/SdDxe: Check the Token to avoid null pointer Guomin Jiang
2020-03-26  6:51 ` [edk2-devel] " Wu, Hao A
2020-03-27  1:06   ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox