diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-17 01:14:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 02:15:26 -0500 |
commit | 8f56a31ad616b13414cf764f620f75f45dac26e6 (patch) | |
tree | 4e53d466c7ef81140ad4f92c78ae7e07f8ceaa87 | |
parent | fd279197b1df6b46076991ca0e1f7faa8f3d8028 (diff) |
[PATCH] drivers/char/esp.c spinlock fix
There's incorrect spinlock usage in espserial_init(): autoconfig() uses
info->lock before it's initialized. The fix is to initialize the spinlock
earlier.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/char/esp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index dd5dc8fa490d..3f3ac039f4d9 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
@@ -2492,6 +2492,7 @@ static int __init espserial_init(void) | |||
2492 | } | 2492 | } |
2493 | 2493 | ||
2494 | memset((void *)info, 0, sizeof(struct esp_struct)); | 2494 | memset((void *)info, 0, sizeof(struct esp_struct)); |
2495 | spin_lock_init(&info->lock); | ||
2495 | /* rx_trigger, tx_trigger are needed by autoconfig */ | 2496 | /* rx_trigger, tx_trigger are needed by autoconfig */ |
2496 | info->config.rx_trigger = rx_trigger; | 2497 | info->config.rx_trigger = rx_trigger; |
2497 | info->config.tx_trigger = tx_trigger; | 2498 | info->config.tx_trigger = tx_trigger; |
@@ -2528,7 +2529,6 @@ static int __init espserial_init(void) | |||
2528 | init_waitqueue_head(&info->close_wait); | 2529 | init_waitqueue_head(&info->close_wait); |
2529 | init_waitqueue_head(&info->delta_msr_wait); | 2530 | init_waitqueue_head(&info->delta_msr_wait); |
2530 | init_waitqueue_head(&info->break_wait); | 2531 | init_waitqueue_head(&info->break_wait); |
2531 | spin_lock_init(&info->lock); | ||
2532 | ports = info; | 2532 | ports = info; |
2533 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", | 2533 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", |
2534 | info->line, info->port, info->irq); | 2534 | info->line, info->port, info->irq); |