--- zzzz-none-000/linux-3.10.107/drivers/isdn/pcbit/drv.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/isdn/pcbit/drv.c 2021-02-04 17:41:59.000000000 +0000 @@ -796,6 +796,7 @@ #endif dev = (struct pcbit_dev *) ptr; + dev->l2_state = L2_DOWN; wake_up_interruptible(&dev->set_running_wq); } @@ -818,7 +819,8 @@ add_timer(&dev->set_running_timer); - interruptible_sleep_on(&dev->set_running_wq); + wait_event(dev->set_running_wq, dev->l2_state == L2_RUNNING || + dev->l2_state == L2_DOWN); del_timer(&dev->set_running_timer); @@ -842,8 +844,6 @@ printk(KERN_DEBUG "pcbit: initialization failed\n"); printk(KERN_DEBUG "pcbit: firmware not loaded\n"); - dev->l2_state = L2_DOWN; - #ifdef DEBUG printk(KERN_DEBUG "Bank3 = %02x\n", readb(dev->sh_mem + BANK3)); @@ -1035,14 +1035,14 @@ } ptr->next = NULL; - ptr->msn = kmalloc(len, GFP_ATOMIC); + ptr->msn = kmalloc(len + 1, GFP_ATOMIC); if (!ptr->msn) { printk(KERN_WARNING "kmalloc failed\n"); kfree(ptr); return; } - memcpy(ptr->msn, sp, len - 1); + memcpy(ptr->msn, sp, len); ptr->msn[len] = 0; #ifdef DEBUG