]> 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)
commit2b44289fa67ea771025fb246c92dd85ceac57f25
treeee7320286f066bfec7739bb8f083367d47fe2d74
parente9e656b7e76e89ac98a9390157bc3e66ec215d7c
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