mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-10-04 08:02:24 +00:00
drm: check for minor master before allowing drop master.
When fast user switching a lot eventually we get to the point, where we were checking for the wrong thing in this function. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
6b0084266c
commit
07f1c7a7f6
@ -185,6 +185,9 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
|
|||||||
if (!file_priv->is_master)
|
if (!file_priv->is_master)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (!file_priv->minor->master)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&dev->struct_mutex);
|
mutex_lock(&dev->struct_mutex);
|
||||||
drm_master_put(&file_priv->minor->master);
|
drm_master_put(&file_priv->minor->master);
|
||||||
file_priv->is_master = 0;
|
file_priv->is_master = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user