- xpcu.interface = -1;
- xpcu.alternate = -1;
- xpcu.dev = dev;
- xpcu.card_type = e->dwCardType;
- pthread_mutex_init(&xpcu.interrupt, NULL);
- e->handle = (unsigned long)&xpcu;
+ xpcu = realloc(xpcu, sizeof(struct xpcu_s) * (++xpcu_event->count));
+ if (!xpcu) {
+ free(xpcu_event);
+ return -ENOMEM;
+ }
+
+ bzero(&(xpcu[n]), sizeof(struct xpcu_s));
+ xpcu[n].interface = -1;
+ xpcu[n].alternate = -1;
+ xpcu[n].dev = dev;
+ xpcu[n].card_type = e->dwCardType;
+
+ xpcu_event->xpcu = xpcu;