If there are not local endpoints left there is no point in starting
the disconnect timer as without any endpoint it is not possible to
configure streams anymore so the code should proceed to disconnect
immediately.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
else
set_disconnect_timer(session);
#else
- set_disconnect_timer(session);
+ /* Only set disconnect timer if there are local endpoints
+ * otherwise disconnect immediately.
+ */
+ if (queue_isempty(session->lseps))
+ connection_lost(session, ECONNRESET);
+ else
+ set_disconnect_timer(session);
#endif
break;
case AVDTP_SESSION_STATE_CONNECTING: