Re: [PATCH v6 3/6] Add support for Out of Band (OOB) association model in hciops

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

 



> Hi Szymon,

Hi,

> > +		data = g_new(struct oob_data, 1);
> > +		bacpy(&data->bdaddr, bdaddr);
> > +		dev->oob_data = g_slist_prepend(dev->oob_data, data);
> 
> Probably g_new0 would be better here (doesn't oob_data have more members
> than just the bdaddr?

Other members (hash and randomizer) are written right after that if-else.

	if (match) {
		data = match->data;
	} else {
		data = g_new(struct oob_data, 1);
		bacpy(&data->bdaddr, bdaddr);
		dev->oob_data = g_slist_prepend(dev->oob_data, data);
	}

	memcpy(data->hash, hash, sizeof(data->hash));
	memcpy(data->randomizer, randomizer, sizeof(data->randomizer));

So there is no need for zeroing data on allocation.

-- 
BR
Szymon Janc
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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