Bluetooth: Fix crash on fast disconnect of SCO
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / sco.c
index 8ec10049bc246125808938b7ea17ce4975498c65..fe129663bd3f7faeb39f20d02a8425d525da071d 100644 (file)
@@ -1033,6 +1033,11 @@ static void sco_conn_ready(struct sco_conn *conn)
        } else {
                sco_conn_lock(conn);
 
+               if (!conn->hcon) {
+                       sco_conn_unlock(conn);
+                       return;
+               }
+
                parent = sco_get_sock_listen(&conn->hcon->src);
                if (!parent) {
                        sco_conn_unlock(conn);