From: Szymon Janc <szymon.janc@tieto.com>
To: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH_v2] android/hal-health: Fix do not modify fd flags in non connected state
Date: Thu, 03 Jul 2014 15:34:59 +0200 [thread overview]
Message-ID: <1606516.mEYMr2KfOU@uw000953> (raw)
In-Reply-To: <1404394161-31721-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Hi Ravi,
On Thursday 03 of July 2014 16:29:21 Ravi kumar Veeramally wrote:
> Only on BTHL_CONN_STATE_CONNECTED state valid fd will be passed. Other states
> fd value is -1. Just call channel status call back.
> ---
> android/hal-health.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/android/hal-health.c b/android/hal-health.c
> index 1ed9fb1..01bc432 100644
> --- a/android/hal-health.c
> +++ b/android/hal-health.c
> @@ -49,6 +49,9 @@ static void handle_channel_state(void *buf, uint16_t len, int fd)
> struct hal_ev_health_channel_state *ev = buf;
> int flags;
>
> + if (fd < 0)
> + goto end;
> +
> flags = fcntl(fd, F_GETFL, 0);
> if (flags < 0) {
> error("health: fcntl GETFL error: %s", strerror(errno));
> @@ -61,6 +64,7 @@ static void handle_channel_state(void *buf, uint16_t len, int fd)
> return;
> }
>
> +end:
> if (cbacks->channel_state_cb)
> cbacks->channel_state_cb(ev->app_id, (bt_bdaddr_t *) ev->bdaddr,
> ev->mdep_index, ev->channel_id,
>
Patch applied, thanks.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-07-03 13:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 13:29 [PATCH_v2] android/hal-health: Fix do not modify fd flags in non connected state Ravi kumar Veeramally
2014-07-03 13:34 ` 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=1606516.mEYMr2KfOU@uw000953 \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ravikumar.veeramally@linux.intel.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;
as well as URLs for NNTP newsgroup(s).