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 1/7] android/gatt: Unify destroy functions
Date: Thu, 27 Mar 2014 16:23:48 +0100	[thread overview]
Message-ID: <5415794.WkJGC9P26L@uw000953> (raw)
In-Reply-To: <1395853259-15618-1-git-send-email-jakub.tyszkowski@tieto.com>

Hi Jakub,

On Wednesday 26 of March 2014 18:00:53 Jakub Tyszkowski wrote:
> This patch unifies destroy function names. We should also keep destroy
> functions convention as it is in /src/shared/hci.c for example, and
> check passed pointer before dereferencing it.
> ---
>  android/gatt.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index 04e9729..aeb0585 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -96,10 +96,13 @@ static struct queue *conn_wait_queue = NULL;	/* Devs waiting to connect */
>  
>  static void bt_le_discovery_stop_cb(void);
>  
> -static void free_gatt_service(void *data)
> +static void destroy_service(void *data)
>  {
>  	struct service *srvc = data;
>  
> +	if (!srvc)
> +		return;
> +
>  	queue_destroy(srvc->chars, free);
>  	free(srvc);
>  }
> @@ -175,8 +178,11 @@ static void destroy_device(void *data)
>  {
>  	struct gatt_device *dev = data;
>  
> +	if (!dev)
> +		return;
> +
>  	queue_destroy(dev->clients, NULL);
> -	queue_destroy(dev->services, free_gatt_service);
> +	queue_destroy(dev->services, destroy_service);
>  	free(dev);
>  }
>  
> 

Patches 1-5 are now applied. Thanks.

-- 
Best regards, 
Szymon Janc

      parent reply	other threads:[~2014-03-27 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 17:00 [PATCH 1/7] android/gatt: Unify destroy functions Jakub Tyszkowski
2014-03-26 17:00 ` [PATCH 2/7] android/gatt: Use better name for matching function Jakub Tyszkowski
2014-03-26 17:00 ` [PATCH 3/7] android/gatt: Use better name for function filling element_id Jakub Tyszkowski
2014-03-26 17:00 ` [PATCH 4/7] android/gatt: Add helper for service search Jakub Tyszkowski
2014-03-26 17:00 ` [PATCH 5/7] android/gatt: Reduce callback data struct scope Jakub Tyszkowski
2014-03-26 17:00 ` [PATCH 6/7] android/gatt: Fix sendig wrong byte ordered uuids Jakub Tyszkowski
2014-03-27 15:26   ` Szymon Janc
2014-03-26 17:00 ` [PATCH 7/7] android/gatt: Fix cached services having element_id uuid not set Jakub Tyszkowski
2014-03-27 15:23 ` 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=5415794.WkJGC9P26L@uw000953 \
    --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