Re: [PATCH] android/avctp: Fix memory leak: unregister pdu handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrei,

On Tue, Feb 4, 2014 at 11:28 AM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@xxxxxxxxx> wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>
>
> Unregister pdu handlers on shutdown.
> ---
>  android/avctp.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/android/avctp.c b/android/avctp.c
> index 8f35403..8681cb0 100644
> --- a/android/avctp.c
> +++ b/android/avctp.c
> @@ -1462,6 +1462,15 @@ void avctp_shutdown(struct avctp *session)
>         if (session->browsing)
>                 avctp_channel_destroy(session->browsing);
>
> +       if (session->passthrough_id > 0)
> +               avctp_unregister_pdu_handler(session, session->passthrough_id);
> +
> +       if (session->unit_id > 0)
> +               avctp_unregister_pdu_handler(session, session->unit_id);
> +
> +       if (session->subunit_id > 0)
> +               avctp_unregister_pdu_handler(session, session->subunit_id);
> +
>         if (session->control)
>                 avctp_channel_destroy(session->control);
>
> --
> 1.8.3.2

There is no leak, avctp_channel_destroy cleanup all the registered handlers.


-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux