Index: drivers/dahdi/dahdi-base.c =================================================================== --- drivers/dahdi/dahdi-base.c (revision 4600) +++ drivers/dahdi/dahdi-base.c (working copy) @@ -4640,8 +4640,12 @@ chan->echotimer = 0; spin_unlock_irqrestore(&chan->lock, flags); if (ec_state) { - ec_current->echo_can_free(ec_state); - release_echocan(ec_current); + if (ec_current) { + ec_current->echo_can_free(ec_state); + release_echocan(ec_current); + } else { + WARN_ON(1); + } } hw_echocancel_off(chan); @@ -4673,8 +4677,12 @@ chan->ec_current = NULL; spin_unlock_irqrestore(&chan->lock, flags); if (ec_state) { - ec_current->echo_can_free(ec_state); - release_echocan(ec_current); + if (ec_current) { + ec_current->echo_can_free(ec_state); + release_echocan(ec_current); + } else { + WARN_ON(1); + } } ret = -ENODEV; @@ -4713,12 +4721,13 @@ /* got the reference, copy the pointer and use it for making an echo canceler instance if possible */ ec_current = chan->ec_current; - - if ((ret = ec_current->echo_can_create(ecp, params, &ec))) { - release_echocan(ec_current); - - goto exit_with_free; - } + if (ec_current) { + ret = ec_current->echo_can_create(ecp, params, &ec); + if (ret) { + release_echocan(ec_current); + goto exit_with_free; + } + } spin_lock_irqsave(&chan->lock, flags); chan->echocancel = ecp->tap_length;