From: Dave Airlie Date: Sun, 19 Apr 2009 23:32:50 +0000 (+1000) Subject: drm: check for minor master before allowing drop master. X-Git-Tag: MMI-PSA29.97-13-9~28229^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07f1c7a7f6736d9ec2eba57d209c5f48888d841e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm: check for minor master before allowing drop 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 --- 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, 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;