diff options
author | Andy Lutomirski <luto@amacapital.net> | 2013-05-14 01:58:48 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-05-31 05:37:39 +0200 |
commit | 0dd99f1bfc8a3661f095c00f9f86f5bafbd4fdff (patch) | |
tree | 20f13d7a2e54acff0871bc92d111665e80dd0668 /drivers/gpu/drm/drm_bufs.c | |
parent | drm: Remove mtrr_add and mtrr_del fallback hack for non-MTRR systems (diff) | |
download | linux-0dd99f1bfc8a3661f095c00f9f86f5bafbd4fdff.tar.xz linux-0dd99f1bfc8a3661f095c00f9f86f5bafbd4fdff.zip |
drm: Don't leak phys_wc "handles" to userspace
I didn't fix this in the earlier patch -- it would have broken the
build due to the now-deleted garbage in drm_os_linux.h.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_bufs.c')
-rw-r--r-- | drivers/gpu/drm/drm_bufs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 0190fce20078..5a4dbb410b71 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -414,6 +414,15 @@ int drm_addmap_ioctl(struct drm_device *dev, void *data, /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ map->handle = (void *)(unsigned long)maplist->user_token; + + /* + * It appears that there are no users of this value whatsoever -- + * drmAddMap just discards it. Let's not encourage its use. + * (Keeping drm_addmap_core's returned mtrr value would be wrong -- + * it's not a real mtrr index anymore.) + */ + map->mtrr = -1; + return 0; } |