]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
MdeModulePkg/SdDxe: Check the Token to avoid null pointer
[mirror_edk2.git] / MdeModulePkg / Bus / Sd / SdDxe / SdBlockIo.c
index 9f42abe7e2ad32a7a4bf0874c823a8884c4d6fe2..721f26437724fbad27f386f47cd34070e18ba668 100644 (file)
@@ -1367,7 +1367,14 @@ SdEraseBlocks (
     return Status;\r
   }\r
 \r
-  DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", Lba, BlockNum, Token->Event, Status));\r
+  DEBUG ((\r
+    DEBUG_INFO,\r
+    "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n",\r
+    Lba,\r
+    BlockNum,\r
+    (Token != NULL) ? Token->Event : NULL,\r
+    Status\r
+    ));\r
 \r
   return Status;\r
 }\r