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>
This commit is contained in:
parent
f97259e35d
commit
f4943db14f
@ -85,6 +85,7 @@
|
|||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#include <linux/proc_fs.h>
|
#include <linux/proc_fs.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/sysctl.h>
|
#include <linux/sysctl.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
@ -504,11 +505,12 @@ static int hwicap_open(struct inode *inode, struct file *file)
|
|||||||
struct hwicap_drvdata *drvdata;
|
struct hwicap_drvdata *drvdata;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
|
drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
|
||||||
|
|
||||||
status = mutex_lock_interruptible(&drvdata->sem);
|
status = mutex_lock_interruptible(&drvdata->sem);
|
||||||
if (status)
|
if (status)
|
||||||
return status;
|
goto out;
|
||||||
|
|
||||||
if (drvdata->is_open) {
|
if (drvdata->is_open) {
|
||||||
status = -EBUSY;
|
status = -EBUSY;
|
||||||
@ -528,6 +530,8 @@ static int hwicap_open(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
mutex_unlock(&drvdata->sem);
|
mutex_unlock(&drvdata->sem);
|
||||||
|
out:
|
||||||
|
unlock_kernel();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user