Upstream: bluetooth: Add device to hash before registration
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Thu, 9 Aug 2012 21:57:25 +0000 (18:57 -0300)
committerJaehyun Kim <jeik01.kim@samsung.com>
Thu, 4 Apr 2013 06:40:11 +0000 (15:40 +0900)
commitec04c9a97dd206c311b048d0bb8bcf8a1302570d
tree8f47de2f1d47bd0794cd2f4b45fdc60b76c56389
parent7952b63e6d3310e3503bd6f27a7a38526195eab0
Upstream: bluetooth: Add device to hash before registration

During the connman_device_register() procedure a lookup to the
bluetooth_devices hash table happens, however the device is not on the
hash at this point and the look out fails.

If the registration fails, technology_disable() returns the Failed
message on D-Bus with the error status zero. That happens because we
don't have any device registered.

This patch moves the insertion of the device to before the device
registration.

Change-Id: Iaa0bd5b878e7bcbfdd4518f042da2fd740861bbe
plugins/bluetooth.c