patch-2.4.0-test7 linux/drivers/char/drm/auth.c

Next file: linux/drivers/char/drm/drmP.h
Previous file: linux/drivers/char/drm/agpsupport.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/char/drm/auth.c linux/drivers/char/drm/auth.c
@@ -126,12 +126,12 @@
 	if (priv->magic) {
 		auth.magic = priv->magic;
 	} else {
-		spin_lock(&lock);
 		do {
+			spin_lock(&lock);
 			if (!sequence) ++sequence; /* reserve 0 */
 			auth.magic = sequence++;
+			spin_unlock(&lock);
 		} while (drm_find_file(dev, auth.magic));
-		spin_unlock(&lock);
 		priv->magic = auth.magic;
 		drm_add_magic(dev, priv, auth.magic);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)