mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 05:18:16 +02:00
Avoid a list corruption bug if the device is opened twice by the same pid.
This commit is contained in:
parent
653ff17331
commit
7822ca7a8f
1 changed files with 3 additions and 4 deletions
|
|
@ -76,12 +76,11 @@ int drm_open_helper(dev_t kdev, int flags, int fmt, struct proc *p,
|
|||
priv->devXX = dev;
|
||||
priv->ioctl_count = 0;
|
||||
priv->authenticated = !suser(p);
|
||||
lockmgr(&dev->dev_lock, LK_EXCLUSIVE, 0, p);
|
||||
TAILQ_INSERT_TAIL(&dev->files, priv, link);
|
||||
lockmgr(&dev->dev_lock, LK_RELEASE, 0, p);
|
||||
}
|
||||
|
||||
lockmgr(&dev->dev_lock, LK_EXCLUSIVE, 0, p);
|
||||
TAILQ_INSERT_TAIL(&dev->files, priv, link);
|
||||
lockmgr(&dev->dev_lock, LK_RELEASE, 0, p);
|
||||
|
||||
kdev->si_drv1 = dev;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue