summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-03-27 17:59:30 +1000
committerDave Airlie <airlied@linux.ie>2007-03-27 17:59:30 +1000
commit72a1190f6d9acea5fb789bec706c842604954049 (patch)
tree9eef4d78f182bb21390f0046b7ed7fd5c16c34ae
parent674cefd4fe4b537a20a10edcb4ec5df55facca8e (diff)
drm/ttm: make sure dev_mapping is set-up for the first opener of the drm
This was causing an oops in my miniglx code to try and use a TTM-only setup.
-rw-r--r--linux-core/drm_fops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 3521c092..d400a4d5 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -154,10 +154,13 @@ int drm_open(struct inode *inode, struct file *filp)
spin_lock(&dev->count_lock);
if (!dev->open_count++) {
spin_unlock(&dev->count_lock);
- return drm_setup(dev);
+ retcode = drm_setup(dev);
+ goto out;
}
spin_unlock(&dev->count_lock);
}
+
+ out:
mutex_lock(&dev->struct_mutex);
BUG_ON((dev->dev_mapping != NULL) &&
(dev->dev_mapping != inode->i_mapping));