diff options
author | Jeff Mahoney <jeffm@suse.com> | 2007-06-27 17:09:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-28 14:34:54 -0400 |
commit | 58e78475ec706f93e0cc049449ffd11fbfdadb3e (patch) | |
tree | ccafbe9237cb4918c2b725cc64192f3b3b7b57ee /drivers/media | |
parent | 53f3bed0a46c786b17f040005b1bd7a78ddd0770 (diff) |
saa7134: fix thread shutdown handling
This patch changes the test for the thread pid from >= 0 to > 0.
When the saa8134 driver initialization fails after a certain point, it goes
through the complete shutdown process for the driver. Part of shutting it
down includes tearing down the thread for tv audio.
The test for tearing down the thread tests for >= 0. Since the dev
structure is kzalloc'd, the test will always be true if we haven't tried to
start the thread yet. We end up waiting on pid 0 to complete, which will
never happen, so we lock up.
This bug was observed in Novell Bugzilla 284718, when request_irq() failed.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-tvaudio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c index 7b56041186dc..30395d6b5f14 100644 --- a/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c | |||
@@ -1005,7 +1005,7 @@ int saa7134_tvaudio_init2(struct saa7134_dev *dev) | |||
1005 | int saa7134_tvaudio_fini(struct saa7134_dev *dev) | 1005 | int saa7134_tvaudio_fini(struct saa7134_dev *dev) |
1006 | { | 1006 | { |
1007 | /* shutdown tvaudio thread */ | 1007 | /* shutdown tvaudio thread */ |
1008 | if (dev->thread.pid >= 0) { | 1008 | if (dev->thread.pid > 0) { |
1009 | dev->thread.shutdown = 1; | 1009 | dev->thread.shutdown = 1; |
1010 | wake_up_interruptible(&dev->thread.wq); | 1010 | wake_up_interruptible(&dev->thread.wq); |
1011 | wait_for_completion(&dev->thread.exit); | 1011 | wait_for_completion(&dev->thread.exit); |