public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart
@ 2018-06-28  1:38 Hao Wu
  2018-06-28  1:40 ` Wu, Hao A
  0 siblings, 1 reply; 3+ messages in thread
From: Hao Wu @ 2018-06-28  1:38 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Star Zeng, Steven Shi, Eric Dong

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=916

Within function AtaAtapiPassThruStart():
Add missing NULL pointer check for variable 'Instance' under the
'ErrorExit' code logics.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index aab704bcd3..4108bafd85 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -827,12 +827,11 @@ ErrorExit:
     gBS->CloseEvent (Instance->TimerEvent);
   }
 
-  //
-  // Remove all inserted ATA devices.
-  //
-  DestroyDeviceInfoList(Instance);
-
   if (Instance != NULL) {
+    //
+    // Remove all inserted ATA devices.
+    //
+    DestroyDeviceInfoList (Instance);
     FreePool (Instance);
   }
   return EFI_UNSUPPORTED;
-- 
2.12.0.windows.1



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

* Re: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart
  2018-06-28  1:38 [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart Hao Wu
@ 2018-06-28  1:40 ` Wu, Hao A
  2018-06-29  8:45   ` Zeng, Star
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Hao A @ 2018-06-28  1:40 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Zeng, Star, Shi, Steven, Dong, Eric

Correction:
Should be V1 of the patch.

Best Regards,
Hao Wu


> -----Original Message-----
> From: Wu, Hao A
> Sent: Thursday, June 28, 2018 9:39 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Zeng, Star; Shi, Steven; Dong, Eric
> Subject: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check
> in BindingStart
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=916
> 
> Within function AtaAtapiPassThruStart():
> Add missing NULL pointer check for variable 'Instance' under the
> 'ErrorExit' code logics.
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Steven Shi <steven.shi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> index aab704bcd3..4108bafd85 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> @@ -827,12 +827,11 @@ ErrorExit:
>      gBS->CloseEvent (Instance->TimerEvent);
>    }
> 
> -  //
> -  // Remove all inserted ATA devices.
> -  //
> -  DestroyDeviceInfoList(Instance);
> -
>    if (Instance != NULL) {
> +    //
> +    // Remove all inserted ATA devices.
> +    //
> +    DestroyDeviceInfoList (Instance);
>      FreePool (Instance);
>    }
>    return EFI_UNSUPPORTED;
> --
> 2.12.0.windows.1



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

* Re: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart
  2018-06-28  1:40 ` Wu, Hao A
@ 2018-06-29  8:45   ` Zeng, Star
  0 siblings, 0 replies; 3+ messages in thread
From: Zeng, Star @ 2018-06-29  8:45 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Shi, Steven, Dong, Eric, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: Wu, Hao A 
Sent: Thursday, June 28, 2018 9:41 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Shi, Steven <steven.shi@intel.com>; Dong, Eric <eric.dong@intel.com>
Subject: RE: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart

Correction:
Should be V1 of the patch.

Best Regards,
Hao Wu


> -----Original Message-----
> From: Wu, Hao A
> Sent: Thursday, June 28, 2018 9:39 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Zeng, Star; Shi, Steven; Dong, Eric
> Subject: [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr 
> check in BindingStart
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=916
> 
> Within function AtaAtapiPassThruStart():
> Add missing NULL pointer check for variable 'Instance' under the 
> 'ErrorExit' code logics.
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Steven Shi <steven.shi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 9 
> ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> index aab704bcd3..4108bafd85 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
> @@ -827,12 +827,11 @@ ErrorExit:
>      gBS->CloseEvent (Instance->TimerEvent);
>    }
> 
> -  //
> -  // Remove all inserted ATA devices.
> -  //
> -  DestroyDeviceInfoList(Instance);
> -
>    if (Instance != NULL) {
> +    //
> +    // Remove all inserted ATA devices.
> +    //
> +    DestroyDeviceInfoList (Instance);
>      FreePool (Instance);
>    }
>    return EFI_UNSUPPORTED;
> --
> 2.12.0.windows.1



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

end of thread, other threads:[~2018-06-29  8:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28  1:38 [PATCH v2] MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart Hao Wu
2018-06-28  1:40 ` Wu, Hao A
2018-06-29  8:45   ` Zeng, Star

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