Return-Path: MIME-Version: 1.0 In-Reply-To: References: From: Alex Deymo Date: Thu, 16 May 2013 13:34:24 -0700 Message-ID: Subject: Re: a2dp.c: finalize_config(setup) can destroy setup To: Luiz Augusto von Dentz Cc: keybuk , linux-bluetooth Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Luiz, On Thu, May 16, 2013 at 4:02 AM, Luiz Augusto von Dentz wrote: > Looks like there are some new devices that should try to get a hold, > anyway this problem should be fixed ASAP so what about the following > patch: > > diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c > index 215f4db..c6973ae 100644 > --- a/profiles/audio/a2dp.c > +++ b/profiles/audio/a2dp.c > @@ -723,16 +723,12 @@ static void open_cfm(struct avdtp *session, > struct avdtp_local_sep *sep, > if (err) { > setup->stream = NULL; > setup->err = err; > + if (setup->start) > + finalize_resume(setup); > } > > finalize_config(setup); > > - if (!setup->start || !err) > - return; > - > - setup->start = FALSE; > - finalize_resume(setup); > - > return; > } This patch looks good to me. I tried it in the same scenario and valgrind does not complain. Could you please push it to the repo? Thanks, Alex.