summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-11 20:38:47 +0000
committerrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-11 20:38:47 +0000
commit9e52e0da2d4ecf2f16371a8ac48bab94e5a3968d (patch)
treed8098526cd87ffaa6f02ef94f317e401653b5f05
parentc0596f2393912eceaf46f48bdcb8de68bee8fa4a (diff)
Revert an unnecessary trylock. Multiple people have looked at this and nobody
can see any reason why this would be required. (closes issue #10791) Reported by: Matti Patches: patch uploaded by Matti (license 109) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3663 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--zaptel-base.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/zaptel-base.c b/zaptel-base.c
index 9f9ad42..86cddbf 100644
--- a/zaptel-base.c
+++ b/zaptel-base.c
@@ -1136,19 +1136,7 @@ static int set_tone_zone(struct zt_chan *chan, int zone)
if ((zone >= ZT_TONE_ZONE_MAX) || (zone < -1))
return -EINVAL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
- /* Since this routine is called both from IRQ as well as from userspace,
- * it is possible that we could be called during an IRQ while userspace
- * has locked this. However unlikely, this could possibly cause a
- * deadlock. */
- if (! read_trylock(&zone_lock))
- return -EWOULDBLOCK;
-#else
- /* But there are no trylock macros for kernel versions before 2.6.11,
- * so we do the unsafe thing anyway. Such is the problem for dealing
- * with old, buggy kernels. */
read_lock(&zone_lock);
-#endif
if (zone == -1) {
zone = default_zone;
@@ -1162,6 +1150,7 @@ static int set_tone_zone(struct zt_chan *chan, int zone)
}
read_unlock(&zone_lock);
+
return res;
}