Re: [PATCH 2/7] Bluetooth: Don't take any action in smp_resume_cb if not encrypted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On Friday 05 of September 2014 13:51:01 johan.hedberg@xxxxxxxxx wrote:
> From: Johan Hedberg <johan.hedberg@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux