Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100304
b: refs/heads/master
c: f4943db
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 86a848d commit 7cb5f3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f97259e35de1f99ba0ac19383408e247fd763cf0
refs/heads/master: f4943db14f5071ecbf7ca76722e59a2fd22bda4d
6 changes: 5 additions & 1 deletion trunk/drivers/char/xilinx_hwicap/xilinx_hwicap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand All @@ -528,6 +530,8 @@ static int hwicap_open(struct inode *inode, struct file *file)

error:
mutex_unlock(&drvdata->sem);
out:
unlock_kernel();
return status;
}

Expand Down

0 comments on commit 7cb5f3d

Please sign in to comment.