MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
Recent change c9742578 exposes this potential issue.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Liming Gao 2021-11-16 10:52:07 +08:00 committed by mergify[bot]
parent e1e7306b54
commit 4c7ce0d285
1 changed files with 7 additions and 0 deletions

View File

@ -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.