summaryrefslogtreecommitdiff
path: root/drivers/regulator/bd9571mwv-regulator.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2019-12-16 14:08:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-31 18:46:10 +0300
commit385fc1fb7545ea99a8aa1094cf527d909b43a705 (patch)
tree9243720005de1a27d8fa42a6b6e0f3244572e167 /drivers/regulator/bd9571mwv-regulator.c
parent78796f74a93e4c5d70e7da3ac952ccfaabd91492 (diff)
downloadlinux-385fc1fb7545ea99a8aa1094cf527d909b43a705.tar.xz
staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value
commit ab42b48f32d4c766420c3499ee9c0289b7028182 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>
Diffstat (limited to 'drivers/regulator/bd9571mwv-regulator.c')
0 files changed, 0 insertions, 0 deletions