mirror of https://github.com/acidanthera/audk.git
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> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
parent
90fa59f685
commit
5a16ba3ae1
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue