OpenCloudOS-Kernel/drivers/staging
Ian Abbott 9fea3a40f6 staging: comedi: ni_routes: allow partial routing information
This patch fixes a regression on setting up asynchronous commands to use
external trigger sources when board-specific routing information is
missing.

`ni_find_device_routes()` (called via `ni_assign_device_routes()`) finds
the table of register values for the device family and the set of valid
routes for the specific board.  If both are found,
`tables->route_values` is set to point to the table of register values
for the device family and `tables->valid_routes` is set to point to the
list of valid routes for the specific board.  If either is not found,
both `tables->route_values` and `tables->valid_routes` are left set at
their initial null values (initialized by `ni_assign_device_routes()`)
and the function returns `-ENODATA`.

Returning an error results in some routing functionality being disabled.
Unfortunately, leaving `table->route_values` set to `NULL` also breaks
the setting up of asynchronous commands that are configured to use
external trigger sources.  Calls to `ni_check_trigger_arg()` or
`ni_check_trigger_arg_roffs()` while checking the asynchronous command
set-up would result in a null pointer dereference if
`table->route_values` is `NULL`.  The null pointer dereference is fixed
in another patch, but it now results in failure to set up the
asynchronous command.  That is a regression from the behavior prior to
commit 347e244884 ("staging: comedi: tio: implement global tio/ctr
routing") and commit 56d0b826d3 ("staging: comedi: ni_mio_common:
implement new routing for TRIG_EXT").

Change `ni_find_device_routes()` to set `tables->route_values` and/or
`tables->valid_routes` to valid information even if the other one can
only be set to `NULL` due to missing information.  The function will
still return an error in that case.  This should result in
`tables->valid_routes` being valid for all currently supported device
families even if the board-specific routing information is missing.
That should be enough to fix the regression on setting up asynchronous
commands to use external triggers for boards with missing routing
information.

Fixes: 347e244884 ("staging: comedi: tio: implement global tio/ctr routing")
Fixes: 56d0b826d3 ("staging: comedi: ni_mio_common: implement new routing for TRIG_EXT").
Cc: <stable@vger.kernel.org> # 4.20+
Cc: Spencer E. Olson <olsonse@umich.edu>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20200114182532.132058-3-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-15 13:30:09 +01:00
..
android compat_ioctl: move more drivers to compat_ptr_ioctl 2019-10-23 17:23:44 +02:00
axis-fifo staging: axis-fifo: add unspecified HAS_IOMEM dependency 2019-12-17 09:22:11 +01:00
board staging: board: use appropriate macro to initialize struct 2019-09-30 21:57:57 +02:00
clocking-wizard staging: clocking-wizard: use devm_platform_ioremap_resource() to simplify code 2019-10-10 11:00:59 +02:00
comedi staging: comedi: ni_routes: allow partial routing information 2020-01-15 13:30:09 +01:00
emxx_udc staging: emxx_udc: Fix invalid reference error 2019-10-30 10:38:46 +01:00
exfat staging: exfat: fix multiple definition error of `rename_file' 2019-12-10 10:56:55 +01:00
fbtft fbtft: Fix the initialization from property algorithm 2019-12-10 15:55:55 +01:00
fieldbus staging: fieldbus: anybuss: use devm_platform_ioremap_resource helper 2019-10-27 08:15:43 +01:00
fsl-dpaa2 staging: dpaa2-ethsw: ordered workqueue should be per ethsw 2019-11-13 00:10:16 +01:00
fwserial staging: fwserial: Fix Kconfig indentation (seven spaces) 2019-11-22 11:32:54 +01:00
gasket pci-v5.5-changes 2019-12-03 13:58:22 -08:00
gdm724x
goldfish staging: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:50:04 +02:00
greybus staging: greybus: light: fix a couple double frees 2019-09-03 09:39:10 +02:00
gs_fpgaboot
hp staging: hp100: Fix build error without ETHERNET 2019-12-10 10:56:54 +01:00
iio staging: iio: ad9834: add a check for devm_clk_get 2019-10-18 20:08:01 +01:00
isdn staging: gigaset: add endpoint-type sanity check 2019-12-10 11:08:07 +01:00
kpc2000 staging: KPC2000: kpc2000_spi.c: Fix style issues (Unnecessary parenthesis) 2019-10-30 10:38:50 +01:00
ks7010 Revert "staging: ks7010: Fix build error" 2019-06-24 16:45:34 +08:00
media media: intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes 2020-01-03 15:02:59 +01:00
most Staging / IIO patches for 5.5-rc1 2019-11-27 10:57:52 -08:00
mt7621-dma staging: mt7621-dma: align to match open parenthesis 2019-11-07 16:14:10 +01:00
mt7621-dts staging: mt7621-dts: add support for second network interface 2019-07-03 18:28:29 +02:00
mt7621-pci MIPS: ralink: enable PCI support only if driver for mt7621 SoC is selected 2019-11-14 13:09:37 +08:00
mt7621-pci-phy staging: mt7621-pci-phy: remove disable clock from the phy exit function 2019-06-21 16:50:10 +02:00
mt7621-pinctrl staging: mt7621-pinctrl: Add of_node_put() before return 2019-07-22 07:34:15 +02:00
netlogic Staging: Netlogic: Fix spelling mistake 2019-10-24 23:08:32 -04:00
nvec staging: nvec: Fix Kconfig indentation 2019-11-20 15:20:29 +01:00
octeon staging/octeon: Mark Ethernet driver as BROKEN 2019-12-10 10:03:01 +01:00
octeon-usb staging: octeon-usb: Fix line ending with a '(' 2019-10-28 16:41:42 +01:00
olpc_dcon staging: olpc_dcon: fix wrong dependencies in Kconfig file 2019-09-30 21:58:00 +02:00
pi433 compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
qlge treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
ralink-gdma staging: ralink-gdma: use devm_platform_ioremap_resource() to simplify code 2019-10-24 22:40:38 -04:00
rtl8188eu staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21 2020-01-03 11:47:00 +01:00
rtl8192e staging: rtl8192e: remove set but not used variable 'frag' 2019-11-18 12:49:40 +01:00
rtl8192u staging: rtl*: Remove tasklet callback casts 2019-11-16 14:41:02 +01:00
rtl8712 staging: rtl8712: fix interface sanity check 2019-12-10 13:22:21 +01:00
rtl8723bs staging: rtl8723bs: remove set but not used variable 'change', 'pos' 2019-11-18 12:49:42 +01:00
rts5208 staging: rts5208: Eliminate the use of Camel Case in file sd.h 2019-11-01 10:55:10 +01:00
sm750fb staging: sm750fb: Replace multiple spaces with tabs when it suits 2019-10-30 10:38:47 +01:00
speakup staging: speakup: document sysfs attributes 2019-10-04 10:06:05 +02:00
unisys Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
uwb staging: uwb: fix coccinelle warnings of comparison to bool 2019-10-24 23:03:00 -04:00
vc04_services staging: vchiq: call unregister_chrdev_region() when driver registration fails 2019-12-10 10:56:56 +01:00
vme compat_ioctl: move more drivers to compat_ptr_ioctl 2019-10-23 17:23:44 +02:00
vt6655 staging: vt6655: Fix long lines 2019-11-03 13:09:00 +01:00
vt6656 staging: vt6656: set usb_set_intfdata on driver fail. 2020-01-03 11:46:59 +01:00
wfx staging: wfx: fix wrong error message 2019-12-18 15:51:06 +01:00
wilc1000 staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param() 2019-11-11 16:37:59 +01:00
wlan-ng staging/wlan-ng: add CRC32 dependency in Kconfig 2019-12-10 10:56:54 +01:00
wusbcore staging: wusbcore: Fix build error without CONFIG_USB 2019-08-09 14:56:57 +02:00
Kconfig Staging / IIO patches for 5.5-rc1 2019-11-27 10:57:52 -08:00
Makefile Staging / IIO patches for 5.5-rc1 2019-11-27 10:57:52 -08:00