Re: [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux