From ba94fab792c6e6369f2fa87106023cf576b9fc78 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 7 Jan 2008 11:05:21 +0000 Subject: [PATCH] Only set SRF_RT subdevice flag if comedi_switch_to_rt(dev) succeeds. --- comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 181cd032..e182e509 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1051,8 +1051,8 @@ static int do_cmd_ioctl(comedi_device * dev, void *arg, void *file) #ifdef CONFIG_COMEDI_RT if (async->cmd.flags & TRIG_RT) { - comedi_switch_to_rt(dev); - comedi_set_subdevice_runflags(s, SRF_RT, SRF_RT); + if (comedi_switch_to_rt(dev) == 0) + comedi_set_subdevice_runflags(s, SRF_RT, SRF_RT); } #endif -- 2.26.2