Return-Path: MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 17 May 2013 09:47:44 +0300 Message-ID: Subject: Re: a2dp.c: finalize_config(setup) can destroy setup From: Luiz Augusto von Dentz To: Alex Deymo Cc: keybuk , linux-bluetooth Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Alex, On Thu, May 16, 2013 at 11:34 PM, Alex Deymo wrote: > 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? Pushed, thanks for testing it. -- Luiz Augusto von Dentz