Re: [PATCH] Bluetooth: Check for chan_type before locking sk

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

 



Hi Andrei,

> Removes un-needed locking/unlocking if chan_type is not
> L2CAP_CHAN_CONN_ORIENTED and also protects from locking
> zero sk.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>
> ---
>  net/bluetooth/l2cap_core.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index b303eae..916ddb1 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -770,13 +770,12 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
>  	list_for_each_entry_rcu(chan, &conn->chan_l, list) {
>  		struct sock *sk = chan->sk;
>  
> -		bh_lock_sock(sk);
> -
>  		if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
> -			bh_unlock_sock(sk);
>  			continue;
>  		}

this actually raises the question how l2cap_chan is protected. Seems
like we are using the socket lock to protect it. Maybe that needs to be
untangled first.

Regards

Marcel


--
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