summaryrefslogtreecommitdiff
path: root/drivers/char/xilinx_hwicap
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 23:50:20 +0400
committerJonathan Corbet <corbet@lwn.net>2008-06-21 00:05:51 +0400
commitf4943db14f5071ecbf7ca76722e59a2fd22bda4d (patch)
tree04ade540e04e47ef6e155173849b263e842c5ad5 /drivers/char/xilinx_hwicap
parentf97259e35de1f99ba0ac19383408e247fd763cf0 (diff)
downloadlinux-f4943db14f5071ecbf7ca76722e59a2fd22bda4d.tar.xz
xilinx icap: BKL pushdown
Add explicit lock_kernel() calls to hwicap_open() even though the existing locking looks adequate. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char/xilinx_hwicap')
-rw-r--r--drivers/char/xilinx_hwicap/xilinx_hwicap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index 3edf1fc12963..1e1b81e57cdc 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -85,6 +85,7 @@
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <linux/sysctl.h>
#include <linux/version.h>
#include <linux/fs.h>
@@ -504,11 +505,12 @@ static int hwicap_open(struct inode *inode, struct file *file)
struct hwicap_drvdata *drvdata;
int status;
+ lock_kernel();
drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
status = mutex_lock_interruptible(&drvdata->sem);
if (status)
- return status;
+ goto out;
if (drvdata->is_open) {
status = -EBUSY;
@@ -528,6 +530,8 @@ static int hwicap_open(struct inode *inode, struct file *file)
error:
mutex_unlock(&drvdata->sem);
+ out:
+ unlock_kernel();
return status;
}