diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-04 22:28:55 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-04 22:28:55 +0000 |
commit | 4bfb85ae4454f7447be49dca068188014dbbe64c (patch) | |
tree | c77fa366d1001c67b3f299a6b9d65a0275b84237 /channels | |
parent | 9946e292cb7228bb2a8b90c9f3b3b8d84aa2c76f (diff) |
Add comments for two functions that get called with the appropriate call locked,
but perform operations that could result in the pvt structure getting destroyed
before returning again, causing numerous seg faults all over the module.
(inspired by issues #9642, #9569, and #9666, and the work done by stevedavies
and mihai)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67119 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_iax2.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index b5e01c09f..575ee7039 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1294,6 +1294,16 @@ static void iax2_frame_free(struct iax_frame *fr) iax_frame_free(fr); } +/*! + * \brief Queue a frame to a call's owning asterisk channel + * + * \note This function assumes that iaxsl[callno] is locked when called. + * + * \note IMPORTANT NOTE!!! Any time this function is used, even if iaxs[callno] + * was valid before calling it, it may no longer be valid after calling it. + * This function may unlock and lock the mutex associated with this callno, + * meaning that another thread may grab it and destroy the call. + */ static int iax2_queue_frame(int callno, struct ast_frame *f) { /* Assumes lock for callno is already held... */ @@ -1577,6 +1587,14 @@ static void reload_firmware(void) ast_mutex_unlock(&waresl.lock); } +/*! + * \note This function assumes that iaxsl[callno] is locked when called. + * + * \note IMPORTANT NOTE!!! Any time this function is used, even if iaxs[callno] + * was valid before calling it, it may no longer be valid after calling it. + * This function calls iax2_queue_frame(), which may unlock and lock the mutex + * associated with this callno, meaning that another thread may grab it and destroy the call. + */ static int __do_deliver(void *data) { /* Just deliver the packet by using queueing. This is called by |