pandora: defconfig: update
[pandora-kernel.git] / net / bluetooth / rfcomm / core.c
index 38b618c..2d28dfe 100644 (file)
@@ -1146,6 +1146,7 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
                        if (list_empty(&s->dlcs)) {
                                s->state = BT_DISCONN;
                                rfcomm_send_disc(s, 0);
+                               rfcomm_session_clear_timer(s);
                        }
 
                        break;
@@ -1802,6 +1803,11 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
                        continue;
                }
 
+               if (test_bit(RFCOMM_ENC_DROP, &d->flags)) {
+                       __rfcomm_dlc_close(d, ECONNREFUSED);
+                       continue;
+               }
+
                if (test_and_clear_bit(RFCOMM_AUTH_ACCEPT, &d->flags)) {
                        rfcomm_dlc_clear_timer(d);
                        if (d->out) {
@@ -2077,7 +2083,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
                if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) {
                        rfcomm_dlc_clear_timer(d);
                        if (status || encrypt == 0x00) {
-                               __rfcomm_dlc_close(d, ECONNREFUSED);
+                               set_bit(RFCOMM_ENC_DROP, &d->flags);
                                continue;
                        }
                }
@@ -2088,7 +2094,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
                                rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT);
                                continue;
                        } else if (d->sec_level == BT_SECURITY_HIGH) {
-                               __rfcomm_dlc_close(d, ECONNREFUSED);
+                               set_bit(RFCOMM_ENC_DROP, &d->flags);
                                continue;
                        }
                }