summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-02-09 23:01:07 -0600
committerMike Isely <isely@pobox.com>2008-02-09 23:01:07 -0600
commit34a78a4e1da1559415ec6894403439a85dbda29c (patch)
treefe1966d5332d806b86950dda91c03e31cd279f5e /linux/drivers/media/video/pvrusb2
parentdef54dfafa784d5829a95ebe5150f9bc8c0bba6e (diff)
downloadmediapointer-dvb-s2-34a78a4e1da1559415ec6894403439a85dbda29c.tar.gz
mediapointer-dvb-s2-34a78a4e1da1559415ec6894403439a85dbda29c.tar.bz2
pvrusb2: Eliminate timer race during tear-down
From: Mike Isely <isely@pobox.com> 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>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index b3120a1fc..85862f9e3 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2134,13 +2134,13 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
{
if (!hdw) return;
pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw);
- del_timer_sync(&hdw->quiescent_timer);
- del_timer_sync(&hdw->encoder_wait_timer);
if (hdw->workqueue) {
flush_workqueue(hdw->workqueue);
destroy_workqueue(hdw->workqueue);
hdw->workqueue = NULL;
}
+ del_timer_sync(&hdw->quiescent_timer);
+ del_timer_sync(&hdw->encoder_wait_timer);
if (hdw->fw_buffer) {
kfree(hdw->fw_buffer);
hdw->fw_buffer = NULL;