summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/i810_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/i810_drv.c')
-rw-r--r--drivers/char/drm/i810_drv.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c
index d8c49a57d..f212f2bf2 100644
--- a/drivers/char/drm/i810_drv.c
+++ b/drivers/char/drm/i810_drv.c
@@ -35,6 +35,8 @@
#endif
#include "drmP.h"
#include "i810_drv.h"
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
EXPORT_SYMBOL(i810_init);
@@ -484,9 +486,11 @@ int i810_open(struct inode *inode, struct file *filp)
int i810_release(struct inode *inode, struct file *filp)
{
drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
+ drm_device_t *dev;
int retcode = 0;
+ lock_kernel();
+ dev = priv->dev;
DRM_DEBUG("pid = %d, device = 0x%x, open_count = %d\n",
current->pid, dev->device, dev->open_count);
@@ -557,12 +561,14 @@ int i810_release(struct inode *inode, struct file *filp)
atomic_read(&dev->ioctl_count),
dev->blocked);
spin_unlock(&dev->count_lock);
+ unlock_kernel();
return -EBUSY;
}
spin_unlock(&dev->count_lock);
- return i810_takedown(dev);
- }
- spin_unlock(&dev->count_lock);
+ retcode = i810_takedown(dev);
+ } else
+ spin_unlock(&dev->count_lock);
+ unlock_kernel();
return retcode;
}