diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 7626bac38d..bda900a161 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -885,6 +885,13 @@ AhciPrintStatusBlock ( IN UINT32 DebugLevel ) { + // + // Skip NULL pointer + // + if (AtaStatusBlock == NULL) { + return; + } + // // Only print status and error since we have all of the rest printed as // a part of command block print.