From: Lubos Dolezel Date: Mon, 5 Mar 2018 11:12:26 +0000 (+0100) Subject: cclient: Insert card into card list before setting EMM state, fixes #4988 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba31bd49f29c09dcfd1a8085964afe7a72165531;p=thirdparty%2Ftvheadend.git cclient: Insert card into card list before setting EMM state, fixes #4988 --- diff --git a/src/descrambler/cclient.c b/src/descrambler/cclient.c index 9d7ebfe1a..a112fdefc 100644 --- a/src/descrambler/cclient.c +++ b/src/descrambler/cclient.c @@ -198,6 +198,8 @@ cc_new_card(cclient_t *cc, uint16_t caid, uint32_t cardid, uint8_t *ua, if (j > 0) tvhdebug(cc->cc_subsys, "%s: Providers: ID:%08x CAID:%04X:[%s]", cc->cc_name, cardid, caid, buf); + if (allocated) + LIST_INSERT_HEAD(&cc->cc_cards, pcard, cs_card); if (cc->cc_emm && ua) { ua = pcard->cs_ra.ua; i = ua[0] || ua[1] || ua[2] || ua[3] || @@ -207,8 +209,6 @@ cc_new_card(cclient_t *cc, uint16_t caid, uint32_t cardid, uint8_t *ua, } pcard->cs_running = 1; - if (allocated) - LIST_INSERT_HEAD(&cc->cc_cards, pcard, cs_card); return pcard; }