Add explicit lock_kernel calls to phantom_open().
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
#include <linux/interrupt.h>
#include <linux/cdev.h>
#include <linux/phantom.h>
#include <linux/interrupt.h>
#include <linux/cdev.h>
#include <linux/phantom.h>
+#include <linux/smp_lock.h>
#include <asm/atomic.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/io.h>
struct phantom_device *dev = container_of(inode->i_cdev,
struct phantom_device, cdev);
struct phantom_device *dev = container_of(inode->i_cdev,
struct phantom_device, cdev);
nonseekable_open(inode, file);
nonseekable_open(inode, file);
- if (mutex_lock_interruptible(&dev->open_lock))
+ if (mutex_lock_interruptible(&dev->open_lock)) {
+ unlock_kernel();
if (dev->opened) {
mutex_unlock(&dev->open_lock);
if (dev->opened) {
mutex_unlock(&dev->open_lock);
atomic_set(&dev->counter, 0);
dev->opened++;
mutex_unlock(&dev->open_lock);
atomic_set(&dev->counter, 0);
dev->opened++;
mutex_unlock(&dev->open_lock);