[edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access

Wu, Hao A hao.a.wu at intel.com
Tue Nov 16 03:48:19 UTC 2021


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Tuesday, November 16, 2021 10:53 AM
> To: devel at edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu at intel.com>; Ni, Ray <ray.ni at intel.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the
> potential NULL pointer access
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
> Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this
> potential issue.


Reviewed-by: Hao A Wu <hao.a.wu at intel.com>

Best Regards,
Hao Wu


> 
> Signed-off-by: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Ray Ni <ray.ni at 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
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83768): https://edk2.groups.io/g/devel/message/83768
Mute This Topic: https://groups.io/mt/87086877/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list