Linux bluetooth development
 help / color / mirror / Atom feed
From: "Michał Lowas-Rzechonek" <michal.lowas-rzechonek@silvair.com>
To: Inga Stotland <inga.stotland@intel.com>
Cc: linux-bluetooth@vger.kernel.org, brian.gix@intel.com
Subject: Re: [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing
Date: Sat, 29 Jun 2019 10:34:34 +0200	[thread overview]
Message-ID: <20190629083434.edok7cdjwsjt4d7i@kynes> (raw)
In-Reply-To: <20190628230142.16367-3-inga.stotland@intel.com>

Hi Inga,

On 06/28, Inga Stotland wrote:
> +static struct mesh_virtual *add_virtual(const uint8_t *v)
> +{
> +	struct mesh_virtual *virt = l_queue_find(mesh_virtuals,
> +						find_virt_by_label, v);
> +
> +	if (virt) {
> +		virt->ref_cnt++;
> +		return virt;
> +	}
> +
> +	virt = l_new(struct mesh_virtual, 1);
> +
> +	if (!mesh_crypto_virtual_addr(v, &virt->addr)) {
> +		l_free(virt);
> +		return NULL;
> +	}
> +
> +	memcpy(virt->label, v, 16);
> +	virt->ref_cnt++;

I am aware that l_new zeroes the allocated object, but I think it would
be clearer to say "virt->ref_cnt = 1" here.

Sorry I didn't catch that earlier.

Otherwise, the patchset LGTM.

reagrds
-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND

  reply	other threads:[~2019-06-29  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 23:01 [PATCH BlueZ 0/4 v3] Model publication fixes Inga Stotland
2019-06-28 23:01 ` [PATCH BlueZ 1/4 v3] mesh: Clean up model.c and cfg-server.c Inga Stotland
2019-06-28 23:01 ` [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing Inga Stotland
2019-06-29  8:34   ` Michał Lowas-Rzechonek [this message]
2019-06-30  6:42     ` Stotland, Inga
2019-06-28 23:01 ` [PATCH BlueZ 3/4 v3] mesh: Fix and clean up model publication code Inga Stotland
2019-06-28 23:01 ` [PATCH BlueZ 4/4 v3] test: test-mesh - Correctly stop periodic publication Inga Stotland

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=20190629083434.edok7cdjwsjt4d7i@kynes \
    --to=michal.lowas-rzechonek@silvair.com \
    --cc=brian.gix@intel.com \
    --cc=inga.stotland@intel.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