[Intel-gfx] [PATCH 1/3] i915/gvt/dmabuf: vgpu_get_plane_info: validate_range with size in bytes

Uri Lublin uril at redhat.com
Sun Apr 14 14:44:11 UTC 2019


size is kept in pages, validate_range gets bytes.

Signed-off-by: Uri Lublin <uril at redhat.com>
Signed-off-by: Snir Sheriber <ssheribe at redhat.com>
---
 drivers/gpu/drm/i915/gvt/dmabuf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c
index 69a9a1b2ea4a..857e3a02d951 100644
--- a/drivers/gpu/drm/i915/gvt/dmabuf.c
+++ b/drivers/gpu/drm/i915/gvt/dmabuf.c
@@ -284,7 +284,8 @@ static int vgpu_get_plane_info(struct drm_device *dev,
 		return -EFAULT;
 	}
 
-	if (!intel_gvt_ggtt_validate_range(vgpu, info->start, info->size)) {
+	if (!intel_gvt_ggtt_validate_range(vgpu, info->start,
+					   info->size << PAGE_SHIFT)) {
 		gvt_vgpu_err("invalid gma addr\n");
 		return -EFAULT;
 	}
-- 
2.20.1



More information about the Intel-gfx mailing list