From 7cb5f3d715fb67b9fbbcce73373e48c6b6a80cfe Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Fri, 16 May 2008 13:50:20 -0600 Subject: [PATCH] --- yaml --- r: 100304 b: refs/heads/master c: f4943db14f5071ecbf7ca76722e59a2fd22bda4d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ce3bb08ee98c..f9f97cec3e78 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f97259e35de1f99ba0ac19383408e247fd763cf0 +refs/heads/master: f4943db14f5071ecbf7ca76722e59a2fd22bda4d diff --git a/trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 3edf1fc12963..1e1b81e57cdc 100644 --- a/trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c @@ -85,6 +85,7 @@ #include #include #include +#include #include #include #include @@ -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; }