--- chan_dahdi.c.1 2009-08-09 20:57:32.000000000 +1200 +++ chan_dahdi.c 2009-08-09 21:20:51.000000000 +1200 @@ -7406,7 +7406,10 @@ static struct ast_frame *dahdi_read(stru return NULL; } - if ((p->radio || (p->oprmode < 0)) && p->inalarm) return NULL; + if ((p->radio || (p->oprmode < 0)) && p->inalarm) { + ast_mutex_unlock(&p->lock); + return NULL; + } p->subs[idx].f.frametype = AST_FRAME_NULL; p->subs[idx].f.datalen = 0; @@ -7709,6 +7712,7 @@ static struct ast_frame *dahdi_read(stru if (res < 0) { ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel); p->dop.dialstr[0] = '\0'; + ast_mutex_unlock(&p->lock); return NULL; } else { ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);