mirror of https://gitee.com/openkylin/linux.git
a7ed5b3e7d
Currently, there are multiple missing break statements in two switch code
blocks. This makes the execution path to fall all the way down through
to the default cases, which makes the function ni_tio_set_gate_src() to
always return -EINVAL.
Fix this by adding the missing break statements.
Also, notice that due to the absence of the break statements,
the following pieces of code are unreachable:
1078 if (ret)
1079 return ret;
1080 /* 3. reenable & set mode to starts things back up */
1081 ni_tio_set_gate_mode(counter, src);
1098 if (ret)
1099 return ret;
1100 /* 3. reenable & set mode to starts things back up */
1101 ni_tio_set_gate2_mode(counter, src);
So, by adding the missing breaks, this patch also fixes the problem
above.
Addresses-Coverity-ID: 1474165 ("Missing break in switch")
Addresses-Coverity-ID: 1474162 ("Structurally dead code")
Fixes:
|
||
---|---|---|
.. | ||
drivers | ||
kcomedilib | ||
Kconfig | ||
Makefile | ||
TODO | ||
comedi.h | ||
comedi_buf.c | ||
comedi_compat32.c | ||
comedi_compat32.h | ||
comedi_fops.c | ||
comedi_internal.h | ||
comedi_pci.c | ||
comedi_pci.h | ||
comedi_pcmcia.c | ||
comedi_pcmcia.h | ||
comedi_usb.c | ||
comedi_usb.h | ||
comedidev.h | ||
comedilib.h | ||
drivers.c | ||
proc.c | ||
range.c |