Bug #112196: auth.c uses semaphores while holding spinlocks Make spinlocked
region smaller to avoid semaphore.main
parent
761ffd63f3
commit
f75ec3010a
|
@ -126,12 +126,12 @@ int drm_getmagic(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
if (priv->magic) {
|
if (priv->magic) {
|
||||||
auth.magic = priv->magic;
|
auth.magic = priv->magic;
|
||||||
} else {
|
} else {
|
||||||
spin_lock(&lock);
|
|
||||||
do {
|
do {
|
||||||
|
spin_lock(&lock);
|
||||||
if (!sequence) ++sequence; /* reserve 0 */
|
if (!sequence) ++sequence; /* reserve 0 */
|
||||||
auth.magic = sequence++;
|
auth.magic = sequence++;
|
||||||
|
spin_unlock(&lock);
|
||||||
} while (drm_find_file(dev, auth.magic));
|
} while (drm_find_file(dev, auth.magic));
|
||||||
spin_unlock(&lock);
|
|
||||||
priv->magic = auth.magic;
|
priv->magic = auth.magic;
|
||||||
drm_add_magic(dev, priv, auth.magic);
|
drm_add_magic(dev, priv, auth.magic);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue