Merge tag 'dmaengine-5.7-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[linux-2.6-microblaze.git] / drivers / dma / idxd / cdev.c
index 989b7a2..ff49847 100644 (file)
@@ -74,12 +74,10 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
        struct idxd_device *idxd;
        struct idxd_wq *wq;
        struct device *dev;
-       struct idxd_cdev *idxd_cdev;
 
        wq = inode_wq(inode);
        idxd = wq->idxd;
        dev = &idxd->pdev->dev;
-       idxd_cdev = &wq->idxd_cdev;
 
        dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
 
@@ -139,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,