]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
authorLiming Gao <gaoliming@byosoft.com.cn>
Tue, 16 Nov 2021 02:52:07 +0000 (10:52 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 24 Nov 2021 15:25:07 +0000 (15:25 +0000)
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>
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c

index 7626bac38d00b0f2799710dff8fa7186c8ab3545..bda900a1613bf9cc2d7eca78c546f271c7815b62 100644 (file)
@@ -885,6 +885,13 @@ AhciPrintStatusBlock (
   IN UINT32                DebugLevel\r
   )\r
 {\r
+  //\r
+  // Skip NULL pointer\r
+  //\r
+  if (AtaStatusBlock == NULL) {\r
+    return;\r
+  }\r
+\r
   //\r
   // Only print status and error since we have all of the rest printed as\r
   // a part of command block print.\r