diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-11-12 20:30:51 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-11-12 20:30:51 +0000 |
commit | 6e56c39371a551af1e05e53231162e0fc42c6ce0 (patch) | |
tree | 208ddc8abb26093a9da37732eaf903649e4971b0 /bsd/drm_fops.h | |
parent | 1f7598245af7e73b34130a44fbaac230e29d7aad (diff) |
Fix a locking nit, and add asserts in some things that should be called
with locks held.
Diffstat (limited to 'bsd/drm_fops.h')
-rw-r--r-- | bsd/drm_fops.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bsd/drm_fops.h b/bsd/drm_fops.h index 55ef8ce0..e9c5d7a0 100644 --- a/bsd/drm_fops.h +++ b/bsd/drm_fops.h @@ -33,7 +33,6 @@ #include "drmP.h" -/* Requires device lock held */ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p) { #if __FreeBSD_version >= 500021 @@ -45,6 +44,8 @@ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p) #endif drm_file_t *priv; + DRM_SPINLOCK_ASSERT(&dev->dev_lock); + TAILQ_FOREACH(priv, &dev->files, link) if (priv->pid == pid && priv->uid == uid) return priv; @@ -65,7 +66,7 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p, DRM_DEBUG("pid = %d, minor = %d\n", DRM_CURRENTPID, m); DRM_LOCK(); - priv = (drm_file_t *) DRM(find_file_by_proc)(dev, p); + priv = DRM(find_file_by_proc)(dev, p); if (priv) { priv->refs++; } else { |