Merge tag 'drm-intel-next-2014-09-01' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / rfcomm / core.c
index 754b6fe4f742af8ce4662a25065c6caba242295b..af73bc3acb406a6256565a18d0ddf2611a96e07f 100644 (file)
@@ -227,7 +227,8 @@ static int rfcomm_check_security(struct rfcomm_dlc *d)
                break;
        }
 
-       return hci_conn_security(conn->hcon, d->sec_level, auth_type);
+       return hci_conn_security(conn->hcon, d->sec_level, auth_type,
+                                d->out);
 }
 
 static void rfcomm_session_timeout(unsigned long arg)
@@ -1909,10 +1910,13 @@ static struct rfcomm_session *rfcomm_process_rx(struct rfcomm_session *s)
        /* Get data directly from socket receive queue without copying it. */
        while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
                skb_orphan(skb);
-               if (!skb_linearize(skb))
+               if (!skb_linearize(skb)) {
                        s = rfcomm_recv_frame(s, skb);
-               else
+                       if (!s)
+                               break;
+               } else {
                        kfree_skb(skb);
+               }
        }
 
        if (s && (sk->sk_state == BT_CLOSED))