[PATCH 10/11] struct-page-check

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 14 22:54:05 UTC 2019


---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 4a546d5ab96b..22feac2f2992 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -555,6 +555,12 @@ __assign_gem_object_mmap_data(struct drm_file *file,
 		goto out;
 	}
 
+	if (mmap_type != I915_MMAP_TYPE_GTT &&
+	    !i915_gem_object_has_struct_pages(obj)) {
+		ret = -ENODEV;
+		goto out;
+	}
+
 	mmo = kzalloc(sizeof(*mmo), GFP_KERNEL);
 	if (!mmo) {
 		ret = -ENOMEM;
-- 
2.24.0



More information about the Intel-gfx-trybot mailing list