From: Szymon Janc <szymon.janc@tieto.com>
To: johan.hedberg@gmail.com
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/7] Bluetooth: Don't take any action in smp_resume_cb if not encrypted
Date: Fri, 05 Sep 2014 13:19:53 +0200 [thread overview]
Message-ID: <2189455.GHcQgNNsdn@uw000953> (raw)
In-Reply-To: <1409914266-21624-3-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
On Friday 05 of September 2014 13:51:01 johan.hedberg@gmail.com wrote:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> When smp_resume_cb is called if we're not encrypted (i.e. the callback
> wasn't called because we the connection became encrypted) we shouldn't
There is something wrong with this comment in brackets.
> take any action at all. This patch moves also the security_timer
> cancellation behind this condition.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/smp.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
> index b8ecc7bd3e3b..9accb4739488 100644
> --- a/net/bluetooth/smp.c
> +++ b/net/bluetooth/smp.c
> @@ -1533,10 +1533,12 @@ static void smp_resume_cb(struct l2cap_chan *chan)
> if (!smp)
> return;
>
> + if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
> + return;
> +
> cancel_delayed_work(&smp->security_timer);
>
> - if (test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
> - queue_work(hdev->workqueue, &smp->distribute_work);
> + queue_work(hdev->workqueue, &smp->distribute_work);
> }
>
> static void smp_ready_cb(struct l2cap_chan *chan)
>
--
Best regards,
Szymon Janc
next prev parent reply other threads:[~2014-09-05 11:19 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 ` [PATCH 1/7] Bluetooth: Remove unnecessary checks after canceling SMP security timer johan.hedberg
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 [this message]
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=2189455.GHcQgNNsdn@uw000953 \
--to=szymon.janc@tieto.com \
--cc=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;
as well as URLs for NNTP newsgroup(s).