[edk2-devel] [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call

Laszlo Ersek posted 35 patches 6 years, 4 months ago
[edk2-devel] [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call
Posted by Laszlo Ersek 6 years, 4 months ago
- The 2nd parameter of EFI_SERVICE_BINDING_CREATE_CHILD is:

  IN OUT EFI_HANDLE *ChildHandle

- The 2nd parameter of EFI_SERVICE_BINDING_DESTROY_CHILD is:

  IN EFI_HANDLE ChildHandle

Fix the DestroyChild() call in TcpFastbootTransportStop().

This is an actual bugfix; I don't know why the current code doesn't crash.
Perhaps the function is never reached in practice? (It could be tied to an
error path.)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    build-tested only

 EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
index 29f23a82c75f..34f9ba74e4db 100644
--- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
+++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
@@ -503,7 +503,7 @@ TcpFastbootTransportStop (
   Status = mTcpListener->Configure (mTcpListener, NULL);
   ASSERT_EFI_ERROR (Status);
 
-  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, &mTcpHandle);
+  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, mTcpHandle);
 
   // Free any data the user didn't pick up
   Entry = (FASTBOOT_TCP_PACKET_LIST *) GetFirstNode (&mPacketListHead);
-- 
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47390): https://edk2.groups.io/g/devel/message/47390
Mute This Topic: https://groups.io/mt/34180202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call
Posted by Philippe Mathieu-Daudé 6 years, 4 months ago
On 9/17/19 9:49 PM, Laszlo Ersek wrote:
> - The 2nd parameter of EFI_SERVICE_BINDING_CREATE_CHILD is:
> 
>   IN OUT EFI_HANDLE *ChildHandle
> 
> - The 2nd parameter of EFI_SERVICE_BINDING_DESTROY_CHILD is:
> 
>   IN EFI_HANDLE ChildHandle
> 
> Fix the DestroyChild() call in TcpFastbootTransportStop().
> 
> This is an actual bugfix; I don't know why the current code doesn't crash.
> Perhaps the function is never reached in practice? (It could be tied to an
> error path.)
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     build-tested only
> 
>  EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> index 29f23a82c75f..34f9ba74e4db 100644
> --- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> +++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> @@ -503,7 +503,7 @@ TcpFastbootTransportStop (
>    Status = mTcpListener->Configure (mTcpListener, NULL);
>    ASSERT_EFI_ERROR (Status);
>  
> -  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, &mTcpHandle);
> +  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, mTcpHandle);
>  
>    // Free any data the user didn't pick up
>    Entry = (FASTBOOT_TCP_PACKET_LIST *) GetFirstNode (&mPacketListHead);
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47919): https://edk2.groups.io/g/devel/message/47919
Mute This Topic: https://groups.io/mt/34180202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call
Posted by Laszlo Ersek 6 years, 4 months ago
Leif, Ard,

On 09/17/19 21:49, Laszlo Ersek wrote:
> - The 2nd parameter of EFI_SERVICE_BINDING_CREATE_CHILD is:
> 
>   IN OUT EFI_HANDLE *ChildHandle
> 
> - The 2nd parameter of EFI_SERVICE_BINDING_DESTROY_CHILD is:
> 
>   IN EFI_HANDLE ChildHandle
> 
> Fix the DestroyChild() call in TcpFastbootTransportStop().
> 
> This is an actual bugfix; I don't know why the current code doesn't crash.
> Perhaps the function is never reached in practice? (It could be tied to an
> error path.)
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     build-tested only
> 
>  EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

can you please ACK this one too? (Apologies if it's already on your radar.)

Thanks!
Laszlo

> diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> index 29f23a82c75f..34f9ba74e4db 100644
> --- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> +++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> @@ -503,7 +503,7 @@ TcpFastbootTransportStop (
>    Status = mTcpListener->Configure (mTcpListener, NULL);
>    ASSERT_EFI_ERROR (Status);
>  
> -  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, &mTcpHandle);
> +  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, mTcpHandle);
>  
>    // Free any data the user didn't pick up
>    Entry = (FASTBOOT_TCP_PACKET_LIST *) GetFirstNode (&mPacketListHead);
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48094): https://edk2.groups.io/g/devel/message/48094
Mute This Topic: https://groups.io/mt/34180202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call
Posted by Ard Biesheuvel 6 years, 4 months ago
On Tue, 17 Sep 2019 at 21:49, Laszlo Ersek <lersek@redhat.com> wrote:
>
> - The 2nd parameter of EFI_SERVICE_BINDING_CREATE_CHILD is:
>
>   IN OUT EFI_HANDLE *ChildHandle
>
> - The 2nd parameter of EFI_SERVICE_BINDING_DESTROY_CHILD is:
>
>   IN EFI_HANDLE ChildHandle
>
> Fix the DestroyChild() call in TcpFastbootTransportStop().
>
> This is an actual bugfix; I don't know why the current code doesn't crash.
> Perhaps the function is never reached in practice? (It could be tied to an
> error path.)
>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>
> Notes:
>     build-tested only
>
>  EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> index 29f23a82c75f..34f9ba74e4db 100644
> --- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> +++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
> @@ -503,7 +503,7 @@ TcpFastbootTransportStop (
>    Status = mTcpListener->Configure (mTcpListener, NULL);
>    ASSERT_EFI_ERROR (Status);
>
> -  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, &mTcpHandle);
> +  Status = mTcpServiceBinding->DestroyChild (mTcpServiceBinding, mTcpHandle);
>
>    // Free any data the user didn't pick up
>    Entry = (FASTBOOT_TCP_PACKET_LIST *) GetFirstNode (&mPacketListHead);
> --
> 2.19.1.3.g30247aa5d201
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48100): https://edk2.groups.io/g/devel/message/48100
Mute This Topic: https://groups.io/mt/34180202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-