Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] avdtp: Fix crash on connection lost
Date: Wed, 17 Oct 2012 09:28:39 +0200	[thread overview]
Message-ID: <15890511.ludKIz2NbJ@uw000953> (raw)
In-Reply-To: <CABBYNZLbX__mxzwvZMOd3noCeoJTRrXshFTEovM9Tco4bziLRg@mail.gmail.com>

On Tuesday 16 of October 2012 20:34:47 Luiz Augusto von Dentz wrote:
> Hi Szymon,

Hi Luiz,

> >         if (session->io) {
> >                 g_io_channel_shutdown(session->io, FALSE, NULL);
> > @@ -1173,8 +1172,6 @@ static void connection_lost(struct avdtp *session, int err)
> >                 session->io = NULL;
> >         }
> >
> > -       avdtp_set_state(session, AVDTP_SESSION_STATE_DISCONNECTED);
> 
> This is actually the one that we need in case we got disconnect by
> remote after discovery completes. avctp.c has a similar structure to
> handler such states, but without the refcounting all is much simpler.

OK

> 
> >         if (session->io_id) {
> >                 g_source_remove(session->io_id);
> >                 session->io_id = 0;
> > @@ -1221,9 +1218,6 @@ void avdtp_unref(struct avdtp *session)
> >
> >                 if (session->io)
> >                         set_disconnect_timer(session);
> > -               else if (!session->free_lock) /* Drop the local ref if we
> > -                                                aren't connected */
> > -                       session->ref--;
> >         }
> >
> >         if (session->ref > 0)
> > --
> > 1.7.9.5
> 
> We should probably get rid of the free_lock as well.

Well, this is what this patch does, doesn't it?:)

-- 
BR
Szymon Janc

  parent reply	other threads:[~2012-10-17  7:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 12:37 [PATCH] avdtp: Fix crash on connection lost Szymon Janc
2012-10-16 17:34 ` Luiz Augusto von Dentz
2012-10-16 17:43   ` Luiz Augusto von Dentz
2012-10-17  7:28   ` Szymon Janc [this message]
2012-10-17  8:48     ` Luiz Augusto von Dentz
2012-10-17 10:17       ` Szymon Janc
2012-10-17 10:32         ` Luiz Augusto von Dentz

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=15890511.ludKIz2NbJ@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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