From 81633a9b82b97e64cd5ee96da65acbec7d71f9dc Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 1 Feb 2013 14:03:23 +0000 Subject: [PATCH] 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 --- comedi/drivers/comedi_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.26.2