summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorRik Faith <faith@alephnull.com>2000-08-17 20:26:11 +0000
committerRik Faith <faith@alephnull.com>2000-08-17 20:26:11 +0000
commitf75ec3010ad8d15d316f6e6d580c85f9e6b8466e (patch)
tree27da891a1c71869ad9e8293d95aebe93fb06523c /linux
parent761ffd63f3b8c9789afe026e75d384a6d450165a (diff)
Bug #112196: auth.c uses semaphores while holding spinlocks Make spinlocked
region smaller to avoid semaphore.
Diffstat (limited to 'linux')
-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);
}