linux-uconsole/drivers/staging
Ian Abbott e7a0e8396f staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value
commit ab42b48f32 upstream.

The "auto-attach" handler function `gsc_hpdi_auto_attach()` calls
`dma_alloc_coherent()` in a loop to allocate some DMA data buffers, and
also calls it to allocate a buffer for a DMA descriptor chain.  However,
it does not check the return value of any of these calls.  Change
`gsc_hpdi_auto_attach()` to return `-ENOMEM` if any of these
`dma_alloc_coherent()` calls fail.  This will result in the comedi core
calling the "detach" handler `gsc_hpdi_detach()` as part of the
clean-up, which will call `gsc_hpdi_free_dma()` to free any allocated
DMA coherent memory buffers.

Cc: <stable@vger.kernel.org> #4.6+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20191216110823.216237-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-31 16:36:26 +01:00
..
android staging: android: ion: Bail out upon SIGKILL when allocating memory. 2019-08-16 10:12:38 +02:00
axis-fifo staging: axis-fifo: add CONFIG_OF dependency 2019-05-04 09:20:12 +02:00
board
clocking-wizard
comedi staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value 2019-12-31 16:36:26 +01:00
dgnc
emxx_udc
erofs erofs: zero out when listxattr is called with no xattr 2019-12-17 20:35:00 +01:00
fbtft fbtft: Make sure string is NULL terminated 2019-12-31 16:36:10 +01:00
fsl-dpaa2 staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work 2019-07-14 08:11:22 +02:00
fwserial
gasket staging: gasket: apex: fix copy-paste typo 2019-08-16 10:12:37 +02:00
gdm724x
goldfish
greybus staging: greybus: power_supply: fix prop-descriptor request size 2019-05-10 17:54:04 +02:00
gs_fpgaboot
iio Staging: iio: adt7316: Fix i2c data reading, set the data field 2019-12-13 08:51:26 +01:00
ks7010
media media: imx: work around false-positive warning, again 2019-11-20 18:47:16 +01:00
most staging: most: cdev: fix chrdev_region leak in mod_exit 2019-05-10 17:54:05 +02:00
mt29f_spinand
mt7621-dma
mt7621-dts
mt7621-eth
mt7621-mmc
mt7621-pci staging, mt7621-pci: fix build without pci support 2019-05-04 09:20:12 +02:00
mt7621-pinctrl staging: mt7621-pinctrl: use pinconf-generic for 'dt_node_to_map' and 'dt_free_map' 2019-11-06 13:05:27 +01:00
mt7621-spi staging: spi: mt7621: Add return code check on device_reset() 2019-04-05 22:33:11 +02:00
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
rtl8188eu staging: rtl8188eu: fix possible null dereference 2019-12-31 16:34:49 +01:00
rtl8192e staging: rtl8192e: fix potential use after free 2019-12-05 09:21:26 +01:00
rtl8192u staging: rtl8192u: fix multiple memory leaks on error path 2019-12-31 16:34:48 +01:00
rtl8712 staging: rtl8712: fix interface sanity check 2019-12-17 20:34:31 +01:00
rtl8723bs staging: rtl8723bs: Add 024c:0525 to the list of SDIO device-ids 2019-12-05 09:21:26 +01:00
rtlwifi staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc 2019-05-04 09:20:17 +02:00
rts5208
sm750fb
speakup
unisys
vboxvideo
vc04_services staging: bcm2835-camera: Handle empty EOS buffers whilst streaming 2019-07-14 08:11:22 +02:00
vme
vt6655 staging: vt6655: Fix memory leak in vt6655_probe 2019-10-17 13:45:11 -07:00
vt6656 staging: vt6656: use meaningful error code during buffer allocation 2019-07-31 07:26:57 +02:00
wilc1000 staging: wilc1000: fix error path cleanup in wilc_wlan_initialize() 2019-09-16 08:22:17 +02:00
wlan-ng staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS 2019-10-29 09:19:48 +01:00
xgifb
Kconfig
Makefile