From d9165405b31082e40dd55deba5aa7d340181aa4d Mon Sep 17 00:00:00 2001 From: markster Date: Thu, 11 Mar 2004 18:00:08 +0000 Subject: Make sure no path leaves channel lock locked git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2399 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_zap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 1071e225c..b8173e517 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -3463,8 +3463,10 @@ struct ast_frame *zt_read(struct ast_channel *ast) ZT_PARAMS ps; ps.channo = p->channel; - if (ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) + if (ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) { + ast_mutex_unlock(&p->lock); return NULL; + } p->firstradio = 1; p->subs[index].f.frametype = AST_FRAME_CONTROL; if (ps.rxisoffhook) @@ -3580,6 +3582,7 @@ struct ast_frame *zt_read(struct ast_channel *ast) c = tdd_feed(p->tdd,readbuf,READ_SIZE); if (c < 0) { ast_log(LOG_DEBUG,"tdd_feed failed\n"); + ast_mutex_unlock(&p->lock); return NULL; } if (c) { /* if a char to return */ -- cgit v1.2.3