Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 5/6] android/gatt: Initialize crypto first
Date: Tue, 27 May 2014 22:51:56 +0200	[thread overview]
Message-ID: <7658749.JgPr7YaV1P@leonov> (raw)
In-Reply-To: <1401185734-23672-5-git-send-email-jakub.tyszkowski@tieto.com>

Hi Jakub,

On Tuesday 27 of May 2014 12:15:33 Jakub Tyszkowski wrote:
> This fixes the missleading error on crypto setup failure:
> 
> 02-17 20:19:44.639 I/bluetoothd( 1705): bluetoothd[1706]: gatt: Failed
> to allocate memory for queues
> ---
>  android/gatt.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index dab9781..a8f072f 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -5491,15 +5491,20 @@ bool bt_gatt_register(struct ipc *ipc, const
> bdaddr_t *addr) if (!start_listening_io())
>  		return false;
> 
> +	crypto = bt_crypto_new();
> +	if (!crypto) {
> +		error("gatt: Failed to setup crypto.");

listening_io should be cleaned up here.
Also no need for dot at the end of error message.

> +		return false;
> +	}
> +
>  	gatt_devices = queue_new();
>  	gatt_apps = queue_new();
>  	app_connections = queue_new();
>  	listen_apps = queue_new();
>  	gatt_db = gatt_db_new();
> -	crypto = bt_crypto_new();
> 
> -	if (!gatt_devices || !gatt_apps || !listen_apps ||
> -				!app_connections || !gatt_db || !crypto) {
> +	if (!gatt_devices || !gatt_apps || !listen_apps || !app_connections ||
> +								!gatt_db) {
>  		error("gatt: Failed to allocate memory for queues");
> 
>  		queue_destroy(gatt_apps, NULL);

-- 
BR
Szymon Janc

  reply	other threads:[~2014-05-27 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 10:15 [PATCH 1/6] attrib: Fix minor whitespace issue Jakub Tyszkowski
2014-05-27 10:15 ` [PATCH 2/6] gatt: Fix not freeing GError on failure Jakub Tyszkowski
2014-05-27 10:15 ` [PATCH 3/6] android/gatt: Use proper variable to store response length Jakub Tyszkowski
2014-05-27 10:15 ` [PATCH 4/6] shared/gatt-db: Fix cropping permissions value Jakub Tyszkowski
2014-05-27 10:15 ` [PATCH 5/6] android/gatt: Initialize crypto first Jakub Tyszkowski
2014-05-27 20:51   ` Szymon Janc [this message]
2014-05-27 10:15 ` [PATCH 6/6] android/gatt: Exchange mtu on connect if acting as client Jakub Tyszkowski
2014-05-27 20:41   ` Szymon Janc
2014-05-27 20:56 ` [PATCH 1/6] attrib: Fix minor whitespace issue Szymon Janc

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=7658749.JgPr7YaV1P@leonov \
    --to=szymon.janc@tieto.com \
    --cc=jakub.tyszkowski@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