diff options
author | Liming Gao <gaoliming@byosoft.com.cn> | 2021-11-16 10:52:07 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-11-24 15:25:07 +0000 |
commit | 4c7ce0d285bc7fd593718fd5dec02e136cbfad8e (patch) | |
tree | fff7a160925fc12d0d9cded38bf41a23960a9749 | |
parent | e1e7306b54147e65cb7347b060e94f336d4a82d2 (diff) | |
download | edk2-4c7ce0d285bc7fd593718fd5dec02e136cbfad8e.tar.gz |
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>
-rw-r--r-- | MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 @@ -886,6 +886,13 @@ AhciPrintStatusBlock ( )
{
//
+ // 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.
//
|