Skip to content

Commit

Permalink
drm: check for minor master before allowing drop master.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Airlie committed Apr 20, 2009
1 parent 6b00842 commit 07f1c7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
if (!file_priv->is_master)
return -EINVAL;

if (!file_priv->minor->master)
return -EINVAL;

mutex_lock(&dev->struct_mutex);
drm_master_put(&file_priv->minor->master);
file_priv->is_master = 0;
Expand Down

0 comments on commit 07f1c7a

Please sign in to comment.