Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] shared/hfp: Fix calling callback without result_pending set
Date: Mon, 09 Feb 2015 13:29:52 +0100	[thread overview]
Message-ID: <1829256.I1cL0rmahj@leonov> (raw)
In-Reply-To: <1423148831-25507-1-git-send-email-szymon.janc@tieto.com>

On Thursday 05 of February 2015 16:07:09 Szymon Janc wrote:
> Always set pending_result before calling command callback.
> 
> If response will be send from callback pending_result will be
> cleared by either hfp_gw_send_result or hfp_gw_send_error.
> ---
>  src/shared/hfp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/shared/hfp.c b/src/shared/hfp.c
> index 0ce3121..ea6494d 100644
> --- a/src/shared/hfp.c
> +++ b/src/shared/hfp.c
> @@ -183,8 +183,8 @@ static void handle_unknown_at_command(struct hfp_gw
> *hfp, const char *data)
>  {
>  	if (hfp->command_callback) {
> -		hfp->command_callback(data, hfp->command_data);
>  		hfp->result_pending = true;
> +		hfp->command_callback(data, hfp->command_data);
>  	} else {
>  		hfp_gw_send_result(hfp, HFP_RESULT_ERROR);
>  	}
> @@ -263,6 +263,7 @@ done:
>  		return true;
>  	}
> 
> +	hfp->result_pending = true;
>  	handler->callback(&context, type, handler->user_data);
> 
>  	return true;

All patches applied.

-- 
BR
Szymon Janc

      parent reply	other threads:[~2015-02-09 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 15:07 [PATCH 1/3] shared/hfp: Fix calling callback without result_pending set Szymon Janc
2015-02-05 15:07 ` [PATCH 2/3] shared/hfp: Fix calling io read function directly Szymon Janc
2015-02-05 15:07 ` [PATCH 3/3] shared/hfp: Fix not processing input from hfp_gw_send_error Szymon Janc
2015-02-09 12:29 ` Szymon Janc [this message]

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=1829256.I1cL0rmahj@leonov \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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