summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_gem.c
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2017-08-17 19:21:30 +0300
committerNoralf Trønnes <noralf@tronnes.org>2017-09-02 15:21:52 +0300
commit90378e58919285637aa0f063c04ba0c6449d98b1 (patch)
treef0c251ae034c894b217ea704c1a1ad97b6721388 /drivers/gpu/drm/drm_gem.c
parentb7df5749c2f883c4a9b166e3ebb82f9627eddab1 (diff)
downloadlinux-90378e58919285637aa0f063c04ba0c6449d98b1.tar.xz
drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
Reject mapping an imported dma-buf since is's an invalid use-case. Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Eric Anholt <eric@anholt.net> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/1502986891-36764-2-git-send-email-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r--drivers/gpu/drm/drm_gem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 88c6d78ee2d5..8bea0326e7a7 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -333,6 +333,12 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
if (!obj)
return -ENOENT;
+ /* Don't allow imported objects to be mapped */
+ if (obj->import_attach) {
+ ret = -EINVAL;
+ goto out;
+ }
+
ret = drm_gem_create_mmap_offset(obj);
if (ret)
goto out;