Skip to content

Commit

Permalink
spidev: BKL pushdown
Browse files Browse the repository at this point in the history
Add the BKL to spidev_open(), even though the existing locking looks
adequate.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent d21c95c commit 609f9e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/spidev.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>

#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
Expand Down Expand Up @@ -393,6 +394,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
struct spidev_data *spidev;
int status = -ENXIO;

lock_kernel();
mutex_lock(&device_list_lock);

list_for_each_entry(spidev, &device_list, device_entry) {
Expand All @@ -418,6 +420,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
pr_debug("spidev: nothing for minor %d\n", iminor(inode));

mutex_unlock(&device_list_lock);
unlock_kernel();
return status;
}

Expand Down

0 comments on commit 609f9e9

Please sign in to comment.