From: Johan Hedberg <johan.hedberg@gmail.com>
To: chen.ganir@ti.com
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v3 3/5] DeviceInfo: Discover Characteristics
Date: Thu, 29 Mar 2012 13:18:03 +0300 [thread overview]
Message-ID: <20120329101803.GB23176@x220> (raw)
In-Reply-To: <1332948405-1104-4-git-send-email-chen.ganir@ti.com>
Hi Chen,
On Wed, Mar 28, 2012, chen.ganir@ti.com wrote:
> +static void char_free(gpointer user_data)
> +{
> + struct characteristic *c = user_data;
> +
> + g_free(c);
> +}
> +
> static void deviceinfo_free(gpointer user_data)
> {
> struct deviceinfo *d = user_data;
> @@ -55,7 +71,11 @@ static void deviceinfo_free(gpointer user_data)
> if (d->attrib != NULL)
> g_attrib_unref(d->attrib);
>
> + if (d->chars != NULL)
> + g_slist_free_full(d->chars, char_free);
You don't need to check for NULL before calling g_slist_free_full since
NULL is a valid GSList (signifying an empty list). You also don't really
need the char_free function but could simply do:
g_slist_free_full(d->chars, g_free);
Johan
next prev parent reply other threads:[~2012-03-29 10:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 15:26 [PATCH v3 0/5] Add DeviceInformationService plugin chen.ganir
2012-03-28 15:26 ` [PATCH v3 1/5] Add DeviceInformation GATT Client chen.ganir
2012-03-29 10:15 ` Johan Hedberg
2012-03-28 15:26 ` [PATCH v3 2/5] DeviceInfo: Add connection logic chen.ganir
2012-03-28 15:26 ` [PATCH v3 3/5] DeviceInfo: Discover Characteristics chen.ganir
2012-03-29 10:18 ` Johan Hedberg [this message]
2012-03-28 15:26 ` [PATCH v3 4/5] Fix device version in GetProperties chen.ganir
2012-03-29 10:19 ` Johan Hedberg
2012-03-28 15:26 ` [PATCH v3 5/5] DeviceInfo: Read PNP ID chen.ganir
2012-03-29 10:22 ` Johan Hedberg
2012-03-29 10:45 ` Anderson Lizardo
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=20120329101803.GB23176@x220 \
--to=johan.hedberg@gmail.com \
--cc=chen.ganir@ti.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