]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Bluetooth: Fix sk_sndtimeo initialization for L2CAP socket
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Wed, 4 Jan 2012 11:10:41 +0000 (12:10 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 15 Feb 2012 11:09:25 +0000 (13:09 +0200)
sk_sndtime value should be specified in jiffies thus initial value
needs to be converted from miliseconds. Otherwise this timeout is
unreliable when CONFIG_HZ is not set to 1000.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/l2cap_sock.c

index c61d967012b2008547767dd69cec91be0f97d30d..c57027f7606f801c9ac3e3b0d9632abeed7e7e11 100644 (file)
@@ -1002,7 +1002,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
        INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
 
        sk->sk_destruct = l2cap_sock_destruct;
-       sk->sk_sndtimeo = L2CAP_CONN_TIMEOUT;
+       sk->sk_sndtimeo = msecs_to_jiffies(L2CAP_CONN_TIMEOUT);
 
        sock_reset_flag(sk, SOCK_ZAPPED);