aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mul.c
diff options
context:
space:
mode:
authorIan Abbott <[email protected]>2019-12-16 11:08:23 +0000
committerGreg Kroah-Hartman <[email protected]>2019-12-17 09:16:44 +0100
commitab42b48f32d4c766420c3499ee9c0289b7028182 (patch)
tree2d56a261891fec06695b0ecdc40db207a5fe3060 /lib/mpi/mpi-mul.c
parentd1eef1c619749b2a57e514a3fa67d9a516ffa919 (diff)
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: <[email protected]> #4.6+ Signed-off-by: Ian Abbott <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions