* [PATCH] dmaengine: idxd: check return result from check_vma() in cdev
@ 2020-02-25 16:47 Dave Jiang
2020-03-02 7:14 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2020-02-25 16:47 UTC (permalink / raw)
To: vkoul; +Cc: dmaengine
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>
---
drivers/dma/idxd/cdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 1d7347825b95..1706a48d8bbe 100644
--- a/drivers/dma/idxd/cdev.c
+++ b/drivers/dma/idxd/cdev.c
@@ -139,6 +139,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,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: idxd: check return result from check_vma() in cdev
2020-02-25 16:47 [PATCH] dmaengine: idxd: check return result from check_vma() in cdev Dave Jiang
@ 2020-03-02 7:14 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-03-02 7:14 UTC (permalink / raw)
To: Dave Jiang; +Cc: dmaengine
On 25-02-20, 09:47, Dave Jiang wrote:
> The returned result from the check_vma() function in the cdev ->mmap() call
> needs to be handled. Add the check and returning error.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-02 7:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-25 16:47 [PATCH] dmaengine: idxd: check return result from check_vma() in cdev Dave Jiang
2020-03-02 7:14 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox