Commit dea3f665 authored by Jonathan Corbet's avatar Jonathan Corbet

dpt_i20: BKL pushdown

Add lock_kernel() calls to adpt_open()
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 9aaf20cb
...@@ -49,6 +49,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); ...@@ -49,6 +49,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
#include <linux/kernel.h> /* for printk */ #include <linux/kernel.h> /* for printk */
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/smp_lock.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
...@@ -1727,10 +1728,12 @@ static int adpt_open(struct inode *inode, struct file *file) ...@@ -1727,10 +1728,12 @@ static int adpt_open(struct inode *inode, struct file *file)
int minor; int minor;
adpt_hba* pHba; adpt_hba* pHba;
lock_kernel();
//TODO check for root access //TODO check for root access
// //
minor = iminor(inode); minor = iminor(inode);
if (minor >= hba_count) { if (minor >= hba_count) {
unlock_kernel();
return -ENXIO; return -ENXIO;
} }
mutex_lock(&adpt_configuration_lock); mutex_lock(&adpt_configuration_lock);
...@@ -1741,6 +1744,7 @@ static int adpt_open(struct inode *inode, struct file *file) ...@@ -1741,6 +1744,7 @@ static int adpt_open(struct inode *inode, struct file *file)
} }
if (pHba == NULL) { if (pHba == NULL) {
mutex_unlock(&adpt_configuration_lock); mutex_unlock(&adpt_configuration_lock);
unlock_kernel();
return -ENXIO; return -ENXIO;
} }
...@@ -1751,6 +1755,7 @@ static int adpt_open(struct inode *inode, struct file *file) ...@@ -1751,6 +1755,7 @@ static int adpt_open(struct inode *inode, struct file *file)
pHba->in_use = 1; pHba->in_use = 1;
mutex_unlock(&adpt_configuration_lock); mutex_unlock(&adpt_configuration_lock);
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment