aboutsummaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/cdev.c
diff options
context:
space:
mode:
authorGravatar Dave Jiang <dave.jiang@intel.com> 2020-02-25 09:47:46 -0700
committerGravatar Vinod Koul <vkoul@kernel.org> 2020-03-02 12:43:49 +0530
commitb391554c61cb353c279523a706734b090aaf9000 (patch)
tree5ae8af249ed19c15dc64d1f6326793c49affde22 /drivers/dma/idxd/cdev.c
parentdmaengine: tegra-apb: Improve error message about DMA underflow (diff)
downloadlinux-b391554c61cb353c279523a706734b090aaf9000.tar.gz
linux-b391554c61cb353c279523a706734b090aaf9000.tar.bz2
linux-b391554c61cb353c279523a706734b090aaf9000.zip
dmaengine: idxd: check return result from check_vma() in cdev
The returned result from the check_vma() function in the cdev ->mmap() call needs to be handled. Add the check and returning error. Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland") Reported-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/158264926659.9387.14325163515683047959.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/cdev.c')
-rw-r--r--drivers/dma/idxd/cdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 8dfdbe37e381..8f323e7855c4 100644
--- a/drivers/dma/idxd/cdev.c
+++ b/drivers/dma/idxd/cdev.c
@@ -137,6 +137,8 @@ static int idxd_cdev_mmap(struct file *filp, struct vm_area_struct *vma)
dev_dbg(&pdev->dev, "%s called\n", __func__);
rc = check_vma(wq, vma, __func__);
+ if (rc < 0)
+ return rc;
vma->vm_flags |= VM_DONTCOPY;
pfn = (base + idxd_get_wq_portal_full_offset(wq->id,