From 4aabc4a7f68aae11c79b39fa65a9c54d3f3451e7 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Mon, 23 Apr 2012 19:22:58 -0400 Subject: Match replica before spinlocks in ikglp_unlock() --- litmus/ikglp_lock.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/litmus/ikglp_lock.c b/litmus/ikglp_lock.c index 2b50fb1c05fd..b95a1def33a3 100644 --- a/litmus/ikglp_lock.c +++ b/litmus/ikglp_lock.c @@ -1185,6 +1185,13 @@ int ikglp_unlock(struct litmus_lock* l) int err = 0; + fq = ikglp_get_queue(sem, t); // returns NULL if 't' is not owner. + + if (!fq) { + err = -EINVAL; + goto out; + } + #ifdef CONFIG_LITMUS_DGL_SUPPORT dgl_lock = litmus->get_dgl_spinlock(t); #endif @@ -1193,14 +1200,6 @@ int ikglp_unlock(struct litmus_lock* l) lock_global_irqsave(dgl_lock, flags); // TODO: Push this deeper lock_fine_irqsave(&sem->lock, flags); - - fq = ikglp_get_queue(sem, t); // returns NULL if 't' is not owner. - - if (!fq) { - err = -EINVAL; - goto out; - } - TRACE_TASK(t, "Freeing replica %d.\n", ikglp_get_idx(sem, fq)); -- cgit v1.2.2