1diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c 2index 4574c5cb1..c3653b067 100644 3--- a/net/bluetooth/l2cap_sock.c 4+++ b/net/bluetooth/l2cap_sock.c 5@@ -1527,9 +1527,6 @@ static void l2cap_sock_close_cb(struct l2cap_chan *chan) 6 { 7 struct sock *sk = chan->data; 8 9- if (!sk) 10- return; 11- 12 l2cap_sock_kill(sk); 13 } 14 15@@ -1538,9 +1535,6 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err) 16 struct sock *sk = chan->data; 17 struct sock *parent; 18 19- if (!sk) 20- return; 21- 22 BT_DBG("chan %p state %s", chan, state_to_string(chan->state)); 23 24 /* This callback can be called both for server (BT_LISTEN) 25@@ -1732,10 +1726,8 @@ static void l2cap_sock_destruct(struct sock *sk) 26 { 27 BT_DBG("sk %p", sk); 28 29- if (l2cap_pi(sk)->chan) { 30- l2cap_pi(sk)->chan->data = NULL; 31+ if (l2cap_pi(sk)->chan) 32 l2cap_chan_put(l2cap_pi(sk)->chan); 33- } 34 35 if (l2cap_pi(sk)->rx_busy_skb) { 36 kfree_skb(l2cap_pi(sk)->rx_busy_skb); 37diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c 38index cf165b0d1..2a14519a8 100644 39--- a/net/bluetooth/sco.c 40+++ b/net/bluetooth/sco.c 41@@ -93,10 +93,10 @@ static void sco_sock_timeout(struct work_struct *work) 42 43 BT_DBG("sock %p state %d", sk, sk->sk_state); 44 45- lock_sock(sk); 46+ bh_lock_sock(sk); 47 sk->sk_err = ETIMEDOUT; 48 sk->sk_state_change(sk); 49- release_sock(sk); 50+ bh_unlock_sock(sk); 51 52 sock_put(sk); 53 } 54@@ -193,10 +193,10 @@ static void sco_conn_del(struct hci_conn *hcon, int err) 55 56 if (sk) { 57 sock_hold(sk); 58- lock_sock(sk); 59+ bh_lock_sock(sk); 60 sco_sock_clear_timer(sk); 61 sco_chan_del(sk, err); 62- release_sock(sk); 63+ bh_unlock_sock(sk); 64 sock_put(sk); 65 } 66 67@@ -280,8 +280,7 @@ static int sco_connect(struct hci_dev *hdev, struct sock *sk) 68 return err; 69 } 70 71-static int sco_send_frame(struct sock *sk, void *buf, int len, 72- unsigned int msg_flags) 73+static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) 74 { 75 struct sco_conn *conn = sco_pi(sk)->conn; 76 struct sk_buff *skb; 77@@ -293,11 +292,15 @@ static int sco_send_frame(struct sock *sk, void *buf, int len, 78 79 BT_DBG("sk %p len %d", sk, len); 80 81- skb = bt_skb_send_alloc(sk, len, msg_flags & MSG_DONTWAIT, &err); 82+ skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err); 83 if (!skb) 84 return err; 85 86- memcpy(skb_put(skb, len), buf, len); 87+ if (memcpy_from_msg(skb_put(skb, len), msg, len)) { 88+ kfree_skb(skb); 89+ return -EFAULT; 90+ } 91+ 92 hci_send_sco(conn->hcon, skb); 93 94 return len; 95@@ -722,7 +725,6 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, 96 size_t len) 97 { 98 struct sock *sk = sock->sk; 99- void *buf; 100 int err; 101 102 BT_DBG("sock %p, sk %p", sock, sk); 103@@ -734,24 +736,14 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, 104 if (msg->msg_flags & MSG_OOB) 105 return -EOPNOTSUPP; 106 107- buf = kmalloc(len, GFP_KERNEL); 108- if (!buf) 109- return -ENOMEM; 110- 111- if (memcpy_from_msg(buf, msg, len)) { 112- kfree(buf); 113- return -EFAULT; 114- } 115- 116 lock_sock(sk); 117 118 if (sk->sk_state == BT_CONNECTED) 119- err = sco_send_frame(sk, buf, len, msg->msg_flags); 120+ err = sco_send_frame(sk, msg, len); 121 else 122 err = -ENOTCONN; 123 124 release_sock(sk); 125- kfree(buf); 126 return err; 127 } 128 129@@ -1108,10 +1100,10 @@ static void sco_conn_ready(struct sco_conn *conn) 130 131 if (sk) { 132 sco_sock_clear_timer(sk); 133- lock_sock(sk); 134+ bh_lock_sock(sk); 135 sk->sk_state = BT_CONNECTED; 136 sk->sk_state_change(sk); 137- release_sock(sk); 138+ bh_unlock_sock(sk); 139 } else { 140 sco_conn_lock(conn); 141 142@@ -1126,12 +1118,12 @@ static void sco_conn_ready(struct sco_conn *conn) 143 return; 144 } 145 146- lock_sock(parent); 147+ bh_lock_sock(parent); 148 149 sk = sco_sock_alloc(sock_net(parent), NULL, 150 BTPROTO_SCO, GFP_ATOMIC, 0); 151 if (!sk) { 152- release_sock(parent); 153+ bh_unlock_sock(parent); 154 sco_conn_unlock(conn); 155 return; 156 } 157@@ -1152,7 +1144,7 @@ static void sco_conn_ready(struct sco_conn *conn) 158 /* Wake up parent */ 159 parent->sk_data_ready(parent); 160 161- release_sock(parent); 162+ bh_unlock_sock(parent); 163 164 sco_conn_unlock(conn); 165 } 166diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig 167index 83a7af898..33ab1f7a3 100644 168--- a/net/rfkill/Kconfig 169+++ b/net/rfkill/Kconfig 170@@ -32,3 +32,12 @@ config RFKILL_GPIO 171 help 172 If you say yes here you get support of a generic gpio RFKILL 173 driver. 174+ 175+config RFKILL_RK 176+ tristate "Rockchip RFKILL driver" 177+ depends on RFKILL 178+ depends on MMC 179+ depends on ARCH_ROCKCHIP 180+ default y 181+ help 182+ Rockchip rfkill driver for rk29/rk3X 183diff --git a/net/rfkill/Makefile b/net/rfkill/Makefile 184index dc47b6174..beed5b506 100644 185--- a/net/rfkill/Makefile 186+++ b/net/rfkill/Makefile 187@@ -7,3 +7,5 @@ rfkill-y += core.o 188 rfkill-$(CONFIG_RFKILL_INPUT) += input.o 189 obj-$(CONFIG_RFKILL) += rfkill.o 190 obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o 191+rfkill-rk-y += rfkill-wlan.o rfkill-bt.o 192+obj-$(CONFIG_RFKILL_RK) += rfkill-rk.o 193