aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/rfcomm/sock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 30b3721dc6d7..7096cfe3bd5a 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -732,8 +732,9 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c
732static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen) 732static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
733{ 733{
734 struct sock *sk = sock->sk; 734 struct sock *sk = sock->sk;
735 struct sock *l2cap_sk;
736 struct l2cap_conn *conn;
735 struct rfcomm_conninfo cinfo; 737 struct rfcomm_conninfo cinfo;
736 struct l2cap_conn *conn = l2cap_pi(sk)->chan->conn;
737 int len, err = 0; 738 int len, err = 0;
738 u32 opt; 739 u32 opt;
739 740
@@ -776,6 +777,9 @@ static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __u
776 break; 777 break;
777 } 778 }
778 779
780 l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
781 conn = l2cap_pi(l2cap_sk)->chan->conn;
782
779 memset(&cinfo, 0, sizeof(cinfo)); 783 memset(&cinfo, 0, sizeof(cinfo));
780 cinfo.hci_handle = conn->hcon->handle; 784 cinfo.hci_handle = conn->hcon->handle;
781 memcpy(cinfo.dev_class, conn->hcon->dev_class, 3); 785 memcpy(cinfo.dev_class, conn->hcon->dev_class, 3);