linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd] client: Fix regression when calling obc_session_shutdown within callback
@ 2012-04-16 10:40 Luiz Augusto von Dentz
  2012-04-16 20:41 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2012-04-16 10:40 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Commit c07ddfbd019d3545cce2d7ec694143cdc55a2167 introduced the freeing of
the active pending request on obc_session_shutdown without checking if
the request was already processed/terminated.
---
 client/session.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/client/session.c b/client/session.c
index 51acbfa..868eb9f 100644
--- a/client/session.c
+++ b/client/session.c
@@ -494,7 +494,7 @@ void obc_session_shutdown(struct obc_session *session)
 	err = g_error_new(OBEX_IO_ERROR, OBEX_IO_DISCONNECTED,
 						"Session closed by user");
 
-	if (session->p != NULL) {
+	if (session->p != NULL && session->p->id != 0) {
 		if (session->p->func)
 			session->p->func(session, err, session->p->data);
 
@@ -821,6 +821,8 @@ static void session_terminate_transfer(struct obc_session *session,
 		g_queue_delete_link(session->queue, match);
 	}
 
+	p->id = 0;
+
 	obc_session_ref(session);
 
 	if (p->func)
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH obexd] client: Fix regression when calling obc_session_shutdown within callback
  2012-04-16 10:40 [PATCH obexd] client: Fix regression when calling obc_session_shutdown within callback Luiz Augusto von Dentz
@ 2012-04-16 20:41 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-04-16 20:41 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Mon, Apr 16, 2012, Luiz Augusto von Dentz wrote:
> Commit c07ddfbd019d3545cce2d7ec694143cdc55a2167 introduced the freeing of
> the active pending request on obc_session_shutdown without checking if
> the request was already processed/terminated.
> ---
>  client/session.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-16 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16 10:40 [PATCH obexd] client: Fix regression when calling obc_session_shutdown within callback Luiz Augusto von Dentz
2012-04-16 20:41 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).