diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-01-06 17:43:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:31 -0500 |
commit | f59abb161c955b68fd3d473368420c5919733e09 (patch) | |
tree | b316a7acdbc2e2eb819614e61644249937903f47 /drivers | |
parent | 50682bb4de35544466c264c017030de826614367 (diff) |
parport: ieee1284: use del_timer_sync() in parport_wait_event()
Use del_timer_sync() instead of del_timer() to make sure the timer won't
be running when we return from parport_wait_event(), because this would
crash due to destruction of timer_list.
This is untested and just based on a code review. Just think about the
following sequence of events:
- add_timer()
- down_interruptible() is interrupted by a signal.
- we enter the timer callback handler on another CPU.
- del_timer(), but the timer callback is still running.
- eturn from parport_wait_even, which destroys the automatic variable
"timer" while the callback is running on another CPU.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/parport/ieee1284.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index ac2a805ac7ea..8901ecf6e037 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c | |||
@@ -84,7 +84,7 @@ int parport_wait_event (struct parport *port, signed long timeout) | |||
84 | 84 | ||
85 | add_timer (&timer); | 85 | add_timer (&timer); |
86 | ret = down_interruptible (&port->physport->ieee1284.irq); | 86 | ret = down_interruptible (&port->physport->ieee1284.irq); |
87 | if (!del_timer (&timer) && !ret) | 87 | if (!del_timer_sync(&timer) && !ret) |
88 | /* Timed out. */ | 88 | /* Timed out. */ |
89 | ret = 1; | 89 | ret = 1; |
90 | 90 | ||