summaryrefslogtreecommitdiff
path: root/fs/binfmt_elf_fdpic.c
diff options
context:
space:
mode:
authorAlexander Kochetkov <al.kochet@gmail.com>2017-10-04 14:37:23 +0300
committerVinod Koul <vinod.koul@intel.com>2017-10-20 11:46:45 +0530
commite588710311ee5bece284871d613418831d56f2bd (patch)
tree62d76603c0ce97d6d1b1cdfeb07fc5aa066cd733 /fs/binfmt_elf_fdpic.c
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
downloadlwn-e588710311ee5bece284871d613418831d56f2bd.tar.gz
lwn-e588710311ee5bece284871d613418831d56f2bd.zip
dmaengine: pl330: fix descriptor allocation fail
If two concurrent threads call pl330_get_desc() when DMAC descriptor pool is empty it is possible that allocation for one of threads will fail with message: kernel: dma-pl330 20078000.dma-controller: pl330_get_desc:2469 ALERT! Here how that can happen. Thread A calls pl330_get_desc() to get descriptor. If DMAC descriptor pool is empty pl330_get_desc() allocates new descriptor on shared pool using add_desc() and then get newly allocated descriptor using pluck_desc(). At the same time thread B calls pluck_desc() and take newly allocated descriptor. In that case descriptor allocation for thread A will fail. Using on-stack pool for new descriptor allow avoid the issue described. The patch modify pl330_get_desc() to use on-stack pool for allocation new descriptors. Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
0 files changed, 0 insertions, 0 deletions