Skip to contentSkip to conversation

genirq: incorrect unlock in __setup_irq()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 17, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: incorrect unlock in __setup_irq()

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"

kernel/irq/manage.c +1 -1
index acd599a..cdcdf13 100644
@@ -1065,9 +1065,9 @@ mismatch:
 
 out_mask:
 	free_cpumask_var(mask);
+	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 out_thread:
-	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	if (new->thread) {
 		struct task_struct *t = new->thread;
 
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

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"

kernel/irq/manage.c +0 -0
index acd599a..cdcdf13 100644

kernel/irq/manage.c mismatch: · line 1070

Quoted 7 lines
kernel/irq/manage.c +1 -1
@@ -1065,9 +1065,9 @@ mismatch:
 
 out_mask:
 	free_cpumask_var(mask);
+	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 out_thread:
-	raw_spin_unlock_irqrestore(&desc->lock, flags);

That's more than a warning fix, this is a real bug.

-- Steve

Quoted 8 lines
kernel/irq/manage.c +0 -1
 	if (new->thread) {
 		struct task_struct *t = new->thread;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/