linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Sonny Sasaka <sonnysasaka@chromium.org>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] a2dp: Fix ref counting bug of setup_unref
Date: Mon, 1 Jun 2020 09:29:50 -0700	[thread overview]
Message-ID: <CABBYNZLK6H6oPRgY53x0D=EM3HbJyE5aKy2FBgvOUnQk6qCiBA@mail.gmail.com> (raw)
In-Reply-To: <20200530085118.10703-1-sonnysasaka@chromium.org>

Hi Sonny,

On Sat, May 30, 2020 at 1:56 AM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
>
> In a2dp_reconfig, setup is ref-counted by cb_data. However, in the fail
> label setup is unref-ed but cb_data is not cleared. This may cause
> double unref in the future if cb_data gets executed. Instead, we should
> do setup_cb_free to clear cb_data and unref setup.
> ---
>  profiles/audio/a2dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
> index 0d877b132..1b92352cf 100644
> --- a/profiles/audio/a2dp.c
> +++ b/profiles/audio/a2dp.c
> @@ -1719,7 +1719,7 @@ static int a2dp_reconfig(struct a2dp_channel *chan, const char *sender,
>         return 0;
>
>  fail:
> -       setup_unref(setup);
> +       setup_cb_free(cb_data);
>         return err;
>  }
>
> --
> 2.17.1

Applied, thanks.

-- 
Luiz Augusto von Dentz

      reply	other threads:[~2020-06-01 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  8:51 [PATCH] a2dp: Fix ref counting bug of setup_unref Sonny Sasaka
2020-06-01 16:29 ` Luiz Augusto von Dentz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABBYNZLK6H6oPRgY53x0D=EM3HbJyE5aKy2FBgvOUnQk6qCiBA@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sonnysasaka@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).