We don't have to insert an MDL in the list when we receive a request to create a new data channel using a mdlid that it is already created. --- mcap/mcap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mcap/mcap.c b/mcap/mcap.c index 1e55bc7..30e0827 100644 --- a/mcap/mcap.c +++ b/mcap/mcap.c @@ -1033,6 +1033,7 @@ static void process_md_create_mdl_req(struct mcap_mcl *mcl, uint8_t *cmd, mdl = g_malloc0(sizeof(struct mcap_mdl)); mdl->mcl = mcl; mdl->mdlid = mdl_id; + mcl->mdls = g_slist_insert_sorted(mcl->mdls, mdl, compare_mdl); } else if (mdl->state == MDL_CONNECTED) { /* MCAP specification says that we should close the MCL if * it is open when we receive a MD_CREATE_MDL_REQ */ @@ -1041,7 +1042,6 @@ static void process_md_create_mdl_req(struct mcap_mcl *mcl, uint8_t *cmd, mdl->mdep_id = mdep_id; mdl->state = MDL_WAITING; - mcl->mdls = g_slist_insert_sorted(mcl->mdls, mdl, compare_mdl); mcl->state = MCL_PENDING; send5B_cmd(mcl, MCAP_MD_CREATE_MDL_RSP, MCAP_SUCCESS, mdl_id, conf); -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html