linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Mikel Astiz <mikel.astiz.oss@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: Re: [PATCH obexd 2/6] client: fix unreported error case
Date: Tue, 14 Feb 2012 11:11:49 +0200	[thread overview]
Message-ID: <CABBYNZKTfjHKS-jFRF+Vio2Lo08wykOvRgFnvj23bfMP_jO_HQ@mail.gmail.com> (raw)
In-Reply-To: <1329143945-4934-2-git-send-email-mikel.astiz.oss@gmail.com>

Hi Mikel,

On Mon, Feb 13, 2012 at 4:39 PM, Mikel Astiz <mikel.astiz.oss@gmail.com> wrote:
> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
>
> The authorization request of a queued transfer could fail, and this
> needs to be reported to the transfer initiator. Otherwise it would
> likely result in D-Bus timeouts.
> ---
>  client/session.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/client/session.c b/client/session.c
> index cb46510..ea707b3 100644
> --- a/client/session.c
> +++ b/client/session.c
> @@ -734,6 +734,19 @@ static void session_process_queue(struct obc_session *session)
>                        return;
>                }
>
> +               if (p->func) {
> +                       GError *gerr;
> +
> +                       obc_session_ref(session);
> +                       g_set_error(&gerr, OBEX_IO_ERROR, err,
> +                                                       "Authorization failed");
> +
> +                       p->func(session, gerr, p->data);
> +
> +                       g_error_free(gerr);
> +                       obc_session_unref(session);

Im afraid the ref need to be taken before the while to protect against
the callback calling session_shutdown and end up freeing the session.

-- 
Luiz Augusto von Dentz

  reply	other threads:[~2012-02-14  9:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 14:39 [PATCH obexd 1/6] client: fix memory leak in obc_session_put Mikel Astiz
2012-02-13 14:39 ` [PATCH obexd 2/6] client: fix unreported error case Mikel Astiz
2012-02-14  9:11   ` Luiz Augusto von Dentz [this message]
2012-02-13 14:39 ` [PATCH obexd 3/6] client: fix incorrect error check Mikel Astiz
2012-02-14  9:16   ` Luiz Augusto von Dentz
2012-02-14 12:59     ` Johan Hedberg
2012-02-13 14:39 ` [PATCH obexd 4/6] client: fix pbap select when same path given twice Mikel Astiz
2012-02-14  9:17   ` Luiz Augusto von Dentz
2012-02-14 13:01   ` Johan Hedberg
2012-02-13 14:39 ` [PATCH obexd 5/6] client: queue transfers in ftp sessions Mikel Astiz
2012-02-14  9:23   ` Luiz Augusto von Dentz
2012-02-13 14:39 ` [PATCH obexd 6/6] client: queue transfers in pbap sessions Mikel Astiz
2012-02-14  9:24   ` Luiz Augusto von Dentz
2012-02-14 13:03   ` Johan Hedberg
2012-02-14  8:54 ` [PATCH obexd 1/6] client: fix memory leak in obc_session_put 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=CABBYNZKTfjHKS-jFRF+Vio2Lo08wykOvRgFnvj23bfMP_jO_HQ@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mikel.astiz.oss@gmail.com \
    --cc=mikel.astiz@bmw-carit.de \
    /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;
as well as URLs for NNTP newsgroup(s).