From: Ian Abbott Date: Fri, 1 Feb 2013 14:03:23 +0000 (+0000) Subject: comedi_test: fix race when cancelling command X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81633a9b82b97e64cd5ee96da65acbec7d71f9dc;p=comedi.git comedi_test: fix race when cancelling command In waveform_ai_cancel(), replace the call to del_timer() with del_timer_sync() to avoid a race condition between the timer routine which may already be running on another CPU and the caller of the cancel routine which is about to free various bits used by the timer routine (such as async->cmd.chanlist). Signed-off-by: Ian Abbott --- diff --git a/comedi/drivers/comedi_test.c b/comedi/drivers/comedi_test.c index 8321dc4e..6607fda1 100644 --- a/comedi/drivers/comedi_test.c +++ b/comedi/drivers/comedi_test.c @@ -431,7 +431,7 @@ static int waveform_ai_cmd(comedi_device * dev, comedi_subdevice * s) static int waveform_ai_cancel(comedi_device * dev, comedi_subdevice * s) { devpriv->timer_running = 0; - del_timer(&devpriv->timer); + del_timer_sync(&devpriv->timer); return 0; }