From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 1/7] Bluetooth: Remove unnecessary checks after canceling SMP security timer
Date: Fri, 5 Sep 2014 13:51:00 +0300 [thread overview]
Message-ID: <1409914266-21624-2-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1409914266-21624-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@intel.com>
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>
---
net/bluetooth/smp.c | 6 +-----
1 file changed, 1 insertion(+), 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)
smp = chan->data;
cancel_delayed_work_sync(&smp->security_timer);
- if (test_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags))
- schedule_delayed_work(&smp->security_timer, SMP_TIMEOUT);
+ schedule_delayed_work(&smp->security_timer, SMP_TIMEOUT);
}
static __u8 authreq_to_seclevel(__u8 authreq)
@@ -375,9 +374,6 @@ static void smp_chan_destroy(struct l2cap_conn *conn)
BUG_ON(!smp);
cancel_delayed_work_sync(&smp->security_timer);
- /* In case the timeout freed the SMP context */
- if (!chan->data)
- return;
if (work_pending(&smp->distribute_work)) {
cancel_work_sync(&smp->distribute_work);
--
1.9.3
next prev parent reply other threads:[~2014-09-05 10:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 10:50 [PATCH 0/7] Bluetooth: SMP fixes/improvements johan.hedberg
2014-09-05 10:51 ` johan.hedberg [this message]
2014-09-05 10:51 ` [PATCH 2/7] Bluetooth: Don't take any action in smp_resume_cb if not encrypted johan.hedberg
2014-09-05 11:19 ` Szymon Janc
2014-09-05 10:51 ` [PATCH 3/7] Bluetooth: Move identity address update behind a workqueue johan.hedberg
2014-09-05 10:51 ` [PATCH 4/7] Bluetooth: Remove unnecessary deferred work for SMP key distribution johan.hedberg
2014-09-05 10:51 ` [PATCH 5/7] Bluetooth: Fix locking of the SMP context johan.hedberg
2014-09-05 11:20 ` Szymon Janc
2014-09-05 10:51 ` [PATCH 6/7] Bluetooth: Fix calling smp_distribute_keys() when still waiting for keys johan.hedberg
2014-09-05 10:51 ` [PATCH 7/7] Bluetooth: Add strict checks for allowed SMP PDUs johan.hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409914266-21624-2-git-send-email-johan.hedberg@gmail.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox