mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-30 17:50:17 +01:00
BSD: Return EINVAL if drm_unlock is called on an unheld or other-owner lock.
This commit is contained in:
parent
9254e00e4b
commit
6e93c35ba7
1 changed files with 6 additions and 0 deletions
|
|
@ -173,6 +173,12 @@ int drm_unlock(drm_device_t *dev, void *data, struct drm_file *file_priv)
|
|||
DRM_CURRENTPID, lock->context);
|
||||
return EINVAL;
|
||||
}
|
||||
/* Check that the context unlock being requested actually matches
|
||||
* who currently holds the lock.
|
||||
*/
|
||||
if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
|
||||
_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock) != lock->context)
|
||||
return EINVAL;
|
||||
|
||||
atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue