IB/hfi1: Fix user context tail allocation for DMA_RTAIL
[platform/kernel/linux-exynos.git] / drivers / infiniband / hw / hfi1 / file_ops.c
index cb6ff9d..9abc5a9 100644 (file)
@@ -622,7 +622,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma)
                        ret = -EINVAL;
                        goto done;
                }
-               if (flags & VM_WRITE) {
+               if ((flags & VM_WRITE) || !uctxt->rcvhdrtail_kvaddr) {
                        ret = -EPERM;
                        goto done;
                }