From: Ian Abbott Date: Mon, 7 Jan 2008 11:05:21 +0000 (+0000) Subject: Only set SRF_RT subdevice flag if comedi_switch_to_rt(dev) succeeds. X-Git-Tag: v0_7_76~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba94fab792c6e6369f2fa87106023cf576b9fc78;p=comedi.git Only set SRF_RT subdevice flag if comedi_switch_to_rt(dev) succeeds. --- 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