aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-09-05 15:19:48 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:55 -0400
commit1b0921d6be7860271ccf6027891b8215fc28cde5 (patch)
treec20eb40b9aa5347d418ae20e0793cd91a597d6c4 /net/bluetooth
parent434714dc02b286d3f21179c651a6f1a84e199eb7 (diff)
Bluetooth: Remove unnecessary checks after canceling SMP security timer
The SMP security timer used to be able to modify the SMP context state but now days it simply calls hci_disconnect(). It is therefore unnecessary to have extra sanity checks for the SMP context after canceling the timer. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 16c181181775..b8ecc7bd3e3b 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -282,8 +282,7 @@ static void smp_send_cmd(struct l2cap_conn *conn, u8 code, u16 len, void *data)
282 smp = chan->data; 282 smp = chan->data;
283 283
284 cancel_delayed_work_sync(&smp->security_timer); 284 cancel_delayed_work_sync(&smp->security_timer);
285 if (test_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) 285 schedule_delayed_work(&smp->security_timer, SMP_TIMEOUT);
286 schedule_delayed_work(&smp->security_timer, SMP_TIMEOUT);
287} 286}
288 287
289static __u8 authreq_to_seclevel(__u8 authreq) 288static __u8 authreq_to_seclevel(__u8 authreq)
@@ -375,9 +374,6 @@ static void smp_chan_destroy(struct l2cap_conn *conn)
375 BUG_ON(!smp); 374 BUG_ON(!smp);
376 375
377 cancel_delayed_work_sync(&smp->security_timer); 376 cancel_delayed_work_sync(&smp->security_timer);
378 /* In case the timeout freed the SMP context */
379 if (!chan->data)
380 return;
381 377
382 if (work_pending(&smp->distribute_work)) { 378 if (work_pending(&smp->distribute_work)) {
383 cancel_work_sync(&smp->distribute_work); 379 cancel_work_sync(&smp->distribute_work);