Thread (4 messages) 4 messages, 2 authors, 2013-05-17

Re: a2dp.c: finalize_config(setup) can destroy setup

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2013-05-17 06:47:44

Hi Alex,

On Thu, May 16, 2013 at 11:34 PM, Alex Deymo [off-list ref] wrote:
Hi Luiz,

On Thu, May 16, 2013 at 4:02 AM, Luiz Augusto von Dentz
[off-list ref] wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help