Re: [PATCH] avdtp: Fix crash on connection lost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux