Bluetooth: Always restart advertising on disconnect event

Restart advertising on LE disconnect event even if related connection
object was not found.

Change-Id: Ia18831ef4f84edb25bf1443793ebb194971ba1dd
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-06-01 13:23:50 +02:00 committed by Johan Hedberg
commit 4245fc4dc7

View file

@ -530,7 +530,7 @@ static void hci_disconn_complete(struct net_buf *buf)
conn = bt_conn_lookup_handle(handle); conn = bt_conn_lookup_handle(handle);
if (!conn) { if (!conn) {
BT_ERR("Unable to look up conn with handle %u", handle); BT_ERR("Unable to look up conn with handle %u", handle);
return; goto advertise;
} }
conn->err = evt->reason; conn->err = evt->reason;
@ -566,6 +566,7 @@ static void hci_disconn_complete(struct net_buf *buf)
bt_conn_unref(conn); bt_conn_unref(conn);
advertise:
if (atomic_test_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING)) { if (atomic_test_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING)) {
set_advertise_enable(); set_advertise_enable();
} }