Revert "drm/vmwgfx: fix potential UAF in vmwgfx_surface.c"

This reverts commit d6c9142399 which is
commit 2bc5da528dd570c5ecabc107e6fbdbc55974276f upstream.  It was part
of the drm api change that is not needed for Android devices and not
reverting it was breaking the build.

Fixes: b3666e45277b ("Revert "drm: protect drm_master pointers in drm_lease.c"")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5e526266b214116981319d2d2e2dfa442d74279f
This commit is contained in:
Greg Kroah-Hartman 2021-09-20 14:31:19 +02:00
parent 5b4909f961
commit 0dae5f42c0

View File

@ -866,7 +866,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
user_srf->prime.base.shareable = false;
user_srf->prime.base.tfile = NULL;
if (drm_is_primary_client(file_priv))
user_srf->master = drm_file_get_master(file_priv);
user_srf->master = drm_master_get(file_priv->master);
/**
* From this point, the generic resource management functions
@ -1537,7 +1537,7 @@ vmw_gb_surface_define_internal(struct drm_device *dev,
user_srf = container_of(srf, struct vmw_user_surface, srf);
if (drm_is_primary_client(file_priv))
user_srf->master = drm_file_get_master(file_priv);
user_srf->master = drm_master_get(file_priv->master);
ret = ttm_read_lock(&dev_priv->reservation_sem, true);
if (unlikely(ret != 0))