summaryrefslogtreecommitdiff
path: root/linux/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/auth.c')
-rw-r--r--linux/auth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/auth.c b/linux/auth.c
index 9f81c539..4556bd96 100644
--- a/linux/auth.c
+++ b/linux/auth.c
@@ -126,12 +126,12 @@ int drm_getmagic(struct inode *inode, struct file *filp, unsigned int cmd,
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);
}