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

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

 



Hi Michal,

On Sat, 2019-06-29 at 10:34 +0200, Michał Lowas-Rzechonek wrote:
> 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.
> 

I agree, this is better. Thanks for the review.
Inga

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[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