aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/drm_fops.c')
-rw-r--r--drivers/char/drm/drm_fops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index 68f0da801ed8..7a25726f07f7 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -37,6 +37,7 @@
37#include "drmP.h" 37#include "drmP.h"
38#include "drm_sarea.h" 38#include "drm_sarea.h"
39#include <linux/poll.h> 39#include <linux/poll.h>
40#include <linux/smp_lock.h>
40 41
41static int drm_open_helper(struct inode *inode, struct file *filp, 42static int drm_open_helper(struct inode *inode, struct file *filp,
42 struct drm_device * dev); 43 struct drm_device * dev);
@@ -174,12 +175,14 @@ int drm_stub_open(struct inode *inode, struct file *filp)
174 175
175 DRM_DEBUG("\n"); 176 DRM_DEBUG("\n");
176 177
178 /* BKL pushdown: note that nothing else serializes idr_find() */
179 lock_kernel();
177 minor = idr_find(&drm_minors_idr, minor_id); 180 minor = idr_find(&drm_minors_idr, minor_id);
178 if (!minor) 181 if (!minor)
179 return -ENODEV; 182 goto out;
180 183
181 if (!(dev = minor->dev)) 184 if (!(dev = minor->dev))
182 return -ENODEV; 185 goto out;
183 186
184 old_fops = filp->f_op; 187 old_fops = filp->f_op;
185 filp->f_op = fops_get(&dev->driver->fops); 188 filp->f_op = fops_get(&dev->driver->fops);
@@ -189,6 +192,8 @@ int drm_stub_open(struct inode *inode, struct file *filp)
189 } 192 }
190 fops_put(old_fops); 193 fops_put(old_fops);
191 194
195out:
196 unlock_kernel();
192 return err; 197 return err;
193} 198}
194 199