]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
cclient: Insert card into card list before setting EMM state, fixes #4988
authorLubos Dolezel <lubos@dolezel.info>
Mon, 5 Mar 2018 11:12:26 +0000 (12:12 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 5 Mar 2018 13:51:42 +0000 (14:51 +0100)
src/descrambler/cclient.c

index 9d7ebfe1a25c666cbec6d6618b2968d3d6079f4f..a112fdefc636f32a75e29451d586dc8703c67a36 100644 (file)
@@ -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;
 }