From afdabe640da73ca3f61aa0634ffb84de1fc97c13 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 21 Jun 2013 12:50:09 -0400 Subject: [PATCH] this happens in irq context, so use appropriate locking --- kernel-module/xt_MEDIAPROXY.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel-module/xt_MEDIAPROXY.c b/kernel-module/xt_MEDIAPROXY.c index 2742768..e59639c 100644 --- a/kernel-module/xt_MEDIAPROXY.c +++ b/kernel-module/xt_MEDIAPROXY.c @@ -1578,10 +1578,11 @@ static u_int64_t packet_index(struct mp_crypto_context *c, u_int16_t seq; u_int64_t index; long long int diff; + unsigned long flags; seq = ntohs(rtp->seq_num); - spin_lock(&c->lock); + spin_lock_irqsave(&c->lock, flags); /* rfc 3711 section 3.3.1 */ if (unlikely(!s->last_index)) @@ -1606,7 +1607,7 @@ static u_int64_t packet_index(struct mp_crypto_context *c, } } - spin_unlock(&c->lock); + spin_unlock_irqrestore(&c->lock, flags); return index; }