genirq: Fix incorrect unlock in __setup_irq()
authorDan Carpenter <error27@gmail.com>
Thu, 17 Mar 2011 11:43:07 +0000 (14:43 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 17 Mar 2011 14:52:30 +0000 (15:52 +0100)
goto out_thread is called before we take the lock. It causes a gcc
warning: "kernel/irq/manage.c:858: warning: ‘flags’ may be used
uninitialized in this function"

[ tglx: Moved unlock before free_cpumask_var() ]

Signed-off-by: Dan Carpenter <error27@gmail.com>
LKML-Reference: <20110317114307.GJ2008@bicker>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/manage.c

index acd599a..0a2aa73 100644 (file)
@@ -1064,10 +1064,10 @@ mismatch:
        ret = -EBUSY;
 
 out_mask:
+       raw_spin_unlock_irqrestore(&desc->lock, flags);
        free_cpumask_var(mask);
 
 out_thread:
-       raw_spin_unlock_irqrestore(&desc->lock, flags);
        if (new->thread) {
                struct task_struct *t = new->thread;