alistair23-linux/drivers/staging
Ian Abbott ab42b48f32 staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value
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-17 09:16:44 +01:00
..
android
axis-fifo
board
clocking-wizard
comedi staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value 2019-12-17 09:16:44 +01:00
emxx_udc
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
fsl-dpaa2
fwserial
gasket pci-v5.5-changes 2019-12-03 13:58:22 -08:00
gdm724x
goldfish
greybus
gs_fpgaboot
hp staging: hp100: Fix build error without ETHERNET 2019-12-10 10:56:54 +01:00
iio
isdn staging: gigaset: add endpoint-type sanity check 2019-12-10 11:08:07 +01:00
kpc2000
ks7010
media
most Staging / IIO patches for 5.5-rc1 2019-11-27 10:57:52 -08:00
mt7621-dma
mt7621-dts
mt7621-pci
mt7621-pci-phy
mt7621-pinctrl
netlogic
nvec
octeon staging/octeon: Mark Ethernet driver as BROKEN 2019-12-10 10:03:01 +01:00
octeon-usb
olpc_dcon
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
rtl8188eu staging: rtl8188eu: fix interface sanity check 2019-12-10 13:22:21 +01:00
rtl8192e
rtl8192u
rtl8712 staging: rtl8712: fix interface sanity check 2019-12-10 13:22:21 +01:00
rtl8723bs
rts5208
sm750fb
speakup
unisys
uwb
vc04_services staging: vchiq: call unregister_chrdev_region() when driver registration fails 2019-12-10 10:56:56 +01:00
vme
vt6655
vt6656
wfx treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
wilc1000
wlan-ng staging/wlan-ng: add CRC32 dependency in Kconfig 2019-12-10 10:56:54 +01:00
wusbcore
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