mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 14:21:47 +00:00
spidev: BKL pushdown
Add the BKL to spidev_open(), even though the existing locking looks adequate. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
d21c95c569
commit
609f9e92b5
@ -29,6 +29,7 @@
|
|||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
|
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/spi/spidev.h>
|
#include <linux/spi/spidev.h>
|
||||||
@ -393,6 +394,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
|
|||||||
struct spidev_data *spidev;
|
struct spidev_data *spidev;
|
||||||
int status = -ENXIO;
|
int status = -ENXIO;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
mutex_lock(&device_list_lock);
|
mutex_lock(&device_list_lock);
|
||||||
|
|
||||||
list_for_each_entry(spidev, &device_list, device_entry) {
|
list_for_each_entry(spidev, &device_list, device_entry) {
|
||||||
@ -418,6 +420,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
|
|||||||
pr_debug("spidev: nothing for minor %d\n", iminor(inode));
|
pr_debug("spidev: nothing for minor %d\n", iminor(inode));
|
||||||
|
|
||||||
mutex_unlock(&device_list_lock);
|
mutex_unlock(&device_list_lock);
|
||||||
|
unlock_kernel();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user