All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Stotland, Inga" <inga.stotland@intel.com>
Cc: "luiz.dentz@gmail.com" <luiz.dentz@gmail.com>,
	"johan.hedberg@gmail.com" <johan.hedberg@gmail.com>
Subject: Re: [PATCH BlueZ] mesh: Correctly initialize node's vendor models
Date: Thu, 21 Mar 2019 21:26:40 +0000	[thread overview]
Message-ID: <1553203599.4237.0.camel@intel.com> (raw)
In-Reply-To: <20190321073240.23203-1-inga.stotland@intel.com>

Critical patch applied

On Thu, 2019-03-21 at 00:32 -0700, Inga Stotland wrote:
> This fixes vendor model initialization based on node properties
> collected during Join() method call.
> ---
>  mesh/node.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/mesh/node.c b/mesh/node.c
> index 761a67af4..999d3b8c0 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1177,17 +1177,20 @@ static void add_model_from_properties(struct node_element *ele,
>  static void add_vendor_model_from_properties(struct node_element *ele,
>  					struct l_dbus_message_iter *property)
>  {
> -	struct {
> -		uint16_t v;
> -		uint16_t m;
> -	} id_pair;
> +	struct l_dbus_message_iter ids;
> +	uint16_t v;
> +	uint16_t m;
>  
>  	if (!ele->models)
>  		ele->models = l_queue_new();
>  
> -	while (l_dbus_message_iter_next_entry(property, &id_pair)) {
> +	if (!l_dbus_message_iter_get_variant(property, "a(qq)", &ids))
> +		return;
> +
> +	while (l_dbus_message_iter_next_entry(&ids, &v, &m)) {
>  		struct mesh_model *mod;
> -		mod = mesh_model_vendor_new(ele->idx, id_pair.v, id_pair.m);
> +
> +		mod = mesh_model_vendor_new(ele->idx, v, m);
>  		l_queue_push_tail(ele->models, mod);
>  	}
>  }

      reply	other threads:[~2019-03-21 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21  7:32 [PATCH BlueZ] mesh: Correctly initialize node's vendor models Inga Stotland
2019-03-21 21:26 ` Gix, Brian [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=1553203599.4237.0.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.