diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c index b8d115abac..a4695ffe4d 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;