diff options
author | Dave Airlie <airlied@redhat.com> | 2009-04-19 19:32:50 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-04-19 20:04:28 -0400 |
commit | 07f1c7a7f6736d9ec2eba57d209c5f48888d841e (patch) | |
tree | 0f75684fa43612f4f91d7aaeb91273f91097418f /drivers/gpu/drm/drm_stub.c | |
parent | 6b0084266c1d4917ad9259759a1e7bd623cb3888 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 1b3e0ff57b45..ef878615c49f 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -185,6 +185,9 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data, | |||
185 | if (!file_priv->is_master) | 185 | if (!file_priv->is_master) |
186 | return -EINVAL; | 186 | return -EINVAL; |
187 | 187 | ||
188 | if (!file_priv->minor->master) | ||
189 | return -EINVAL; | ||
190 | |||
188 | mutex_lock(&dev->struct_mutex); | 191 | mutex_lock(&dev->struct_mutex); |
189 | drm_master_put(&file_priv->minor->master); | 192 | drm_master_put(&file_priv->minor->master); |
190 | file_priv->is_master = 0; | 193 | file_priv->is_master = 0; |