Skip to content

Commit

Permalink
drm: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent abedd29 commit 70ffa16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/char/drm/drm_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "drmP.h"
#include "drm_sarea.h"
#include <linux/poll.h>
#include <linux/smp_lock.h>

static int drm_open_helper(struct inode *inode, struct file *filp,
struct drm_device * dev);
Expand Down Expand Up @@ -174,12 +175,14 @@ int drm_stub_open(struct inode *inode, struct file *filp)

DRM_DEBUG("\n");

/* BKL pushdown: note that nothing else serializes idr_find() */
lock_kernel();
minor = idr_find(&drm_minors_idr, minor_id);
if (!minor)
return -ENODEV;
goto out;

if (!(dev = minor->dev))
return -ENODEV;
goto out;

old_fops = filp->f_op;
filp->f_op = fops_get(&dev->driver->fops);
Expand All @@ -189,6 +192,8 @@ int drm_stub_open(struct inode *inode, struct file *filp)
}
fops_put(old_fops);

out:
unlock_kernel();
return err;
}

Expand Down

0 comments on commit 70ffa16

Please sign in to comment.