From b5eb0449c0e6307bb83fe26e6c9cfcacd7ca274e Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Tue, 6 Oct 2009 23:56:01 +0000 Subject: [PATCH] Merged revisions 222462 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r222462 | jpeeler | 2009-10-06 18:51:19 -0500 (Tue, 06 Oct 2009) | 8 lines Add missing unlock(s) in dahdi_read (two cases in trunk) (closes issue #15683) Reported by: alecdavis ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222463 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_dahdi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index a97ff5837d..df46654291 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);