public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
@ 2021-11-16  2:53 gaoliming
  2021-11-16  3:48 ` [edk2-devel] " Wu, Hao A
  2021-11-23 13:10 ` Rebecca Cran
  0 siblings, 2 replies; 5+ messages in thread
From: gaoliming @ 2021-11-16  2:53 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni

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

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
 1 file changed, 7 insertions(+)

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.
-- 
2.27.0.windows.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-24  6:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16  2:53 [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access gaoliming
2021-11-16  3:48 ` [edk2-devel] " Wu, Hao A
2021-11-23 13:10 ` Rebecca Cran
2021-11-23 13:19   ` edk2-stable202111 " Leif Lindholm
2021-11-24  6:17     ` 回复: " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox