diff options
author | Mike Isely <isely@pobox.com> | 2008-04-22 13:45:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:48 -0400 |
commit | 8f59100a42576c49e2170e9dc04f8b7ac922a74d (patch) | |
tree | 022033f2444f4d07d1f2c2804f79969acf8f6f84 /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | c4a8828ddbf5fb445d2679ab006d5743540fc41a (diff) |
V4L/DVB (7320): pvrusb2: Eliminate timer race during tear-down
The pvrusb2 tear-down logic was clearing two timers before stopping
its internal work queue. That left a tiny window open where the work
queue might run after the timers are stopped, possibly starting them
again. This could lead to dangling pointers and an oops. Solution:
Kill the work queue first, then delete the timers.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index f2d2677936b3..1dff2d04a5d9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -2114,13 +2114,13 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) | |||
2114 | { | 2114 | { |
2115 | if (!hdw) return; | 2115 | if (!hdw) return; |
2116 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); | 2116 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); |
2117 | del_timer_sync(&hdw->quiescent_timer); | ||
2118 | del_timer_sync(&hdw->encoder_wait_timer); | ||
2119 | if (hdw->workqueue) { | 2117 | if (hdw->workqueue) { |
2120 | flush_workqueue(hdw->workqueue); | 2118 | flush_workqueue(hdw->workqueue); |
2121 | destroy_workqueue(hdw->workqueue); | 2119 | destroy_workqueue(hdw->workqueue); |
2122 | hdw->workqueue = NULL; | 2120 | hdw->workqueue = NULL; |
2123 | } | 2121 | } |
2122 | del_timer_sync(&hdw->quiescent_timer); | ||
2123 | del_timer_sync(&hdw->encoder_wait_timer); | ||
2124 | if (hdw->fw_buffer) { | 2124 | if (hdw->fw_buffer) { |
2125 | kfree(hdw->fw_buffer); | 2125 | kfree(hdw->fw_buffer); |
2126 | hdw->fw_buffer = NULL; | 2126 | hdw->fw_buffer = NULL; |