diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index a97ff5837d6a049315ad09f62ffa1130b8ab8953..df466542912f5011c8d8f24b82d7a3b33ca550f6 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7674,7 +7674,10 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast) 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; @@ -7977,6 +7980,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast) 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);