aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 @@
85#include <linux/poll.h> 85#include <linux/poll.h>
86#include <linux/proc_fs.h> 86#include <linux/proc_fs.h>
87#include <linux/mutex.h> 87#include <linux/mutex.h>
88#include <linux/smp_lock.h>
88#include <linux/sysctl.h> 89#include <linux/sysctl.h>
89#include <linux/version.h> 90#include <linux/version.h>
90#include <linux/fs.h> 91#include <linux/fs.h>
@@ -504,11 +505,12 @@ static int hwicap_open(struct inode *inode, struct file *file)
504 struct hwicap_drvdata *drvdata; 505 struct hwicap_drvdata *drvdata;
505 int status; 506 int status;
506 507
508 lock_kernel();
507 drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev); 509 drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
508 510
509 status = mutex_lock_interruptible(&drvdata->sem); 511 status = mutex_lock_interruptible(&drvdata->sem);
510 if (status) 512 if (status)
511 return status; 513 goto out;
512 514
513 if (drvdata->is_open) { 515 if (drvdata->is_open) {
514 status = -EBUSY; 516 status = -EBUSY;
@@ -528,6 +530,8 @@ static int hwicap_open(struct inode *inode, struct file *file)
528 530
529 error: 531 error:
530 mutex_unlock(&drvdata->sem); 532 mutex_unlock(&drvdata->sem);
533 out:
534 unlock_kernel();
531 return status; 535 return status;
532} 536}
533 537