]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix having bogus entries in mgmt_read_index_list reply
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 19 Oct 2012 17:10:46 +0000 (20:10 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Fri, 9 Nov 2012 15:45:37 +0000 (16:45 +0100)
commite675cda5f553451fbb2c46d907161616371d2958
treeee7320286f066bfec7739bb8f083367d47fe2d74
parent599dd11e830ec4d5e570063a78a700d698ccd099
Bluetooth: Fix having bogus entries in mgmt_read_index_list reply

The mgmt_read_index_list uses one loop to calculate the max needed size
of its response with the help of an upper-bound of the controller count.
The second loop is more strict as it checks for HCI_SETUP (which might
have gotten set after the first loop) and could result in some indexes
being skipped. Because of this the function needs to readjust the event
length and index count after filling in the response array.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Cc: stable@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c