From: Jonathan Corbet Date: Fri, 16 May 2008 19:50:20 +0000 (-0600) Subject: xilinx icap: BKL pushdown X-Git-Tag: v2.6.27-rc1~1103^2~105 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4943db14f5071ecbf7ca76722e59a2fd22bda4d;p=linux-2.6 xilinx icap: BKL pushdown Add explicit lock_kernel() calls to hwicap_open() even though the existing locking looks adequate. Signed-off-by: Jonathan Corbet --- diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 3edf1fc129..1e1b81e57c 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/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; }