linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Bruna Moreira <bruna.moreira@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] adapter: Fix segfault when icon is uninitialized
Date: Mon, 2 Apr 2012 22:35:20 +0300	[thread overview]
Message-ID: <20120402193520.GA7348@x220.ger.corp.intel.com> (raw)
In-Reply-To: <1333394427-9803-1-git-send-email-bruna.moreira@openbossa.org>

Hi Bruna,

On Mon, Apr 02, 2012, Bruna Moreira wrote:
> If device type is LE and GAP Appearance characteristic does not exist,
> the icon will not be initialized.
> ---
>  src/adapter.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index f8f46f8..9ebfe66 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -2664,7 +2664,7 @@ void adapter_emit_device_found(struct btd_adapter *adapter,
>  {
>  	struct btd_device *device;
>  	char peer_addr[18], local_addr[18];
> -	const char *icon, *paddr = peer_addr;
> +	const char *icon = NULL, *paddr = peer_addr;
>  	dbus_bool_t paired = FALSE, trusted = FALSE;
>  	dbus_int16_t rssi = dev->rssi;
>  	char *alias;

I'd rather do this within the code than by initializing upon
declaration:

                if (read_remote_appearance(&adapter->bdaddr, &dev->bdaddr,
                                                                &app) == 0)
                        icon = gap_appearance_to_icon(app);
+               else
+                       icon = NULL;


Johan

  reply	other threads:[~2012-04-02 19:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 19:20 [PATCH BlueZ] adapter: Fix segfault when icon is uninitialized Bruna Moreira
2012-04-02 19:35 ` Johan Hedberg [this message]
2012-04-02 20:05 ` [PATCH v2 " Bruna Moreira
2012-04-03  9:42   ` Johan Hedberg

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=20120402193520.GA7348@x220.ger.corp.intel.com \
    --to=johan.hedberg@gmail.com \
    --cc=bruna.moreira@openbossa.org \
    --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;
as well as URLs for NNTP newsgroup(s).