diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 17:48:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 17:48:31 -0400 |
commit | d1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch) | |
tree | 5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/net/wan/cosa.c | |
parent | a41eebab7537890409ea9dfe0fcda9b5fbdb090d (diff) | |
parent | 2fceef397f9880b212a74c418290ce69e7ac00eb (diff) |
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits)
IB/umad: BKL is not needed for ib_umad_open()
IB/uverbs: BKL is not needed for ib_uverbs_open()
bf561-coreb: BKL unneeded for open()
Call fasync() functions without the BKL
snd/PCM: fasync BKL pushdown
ipmi: fasync BKL pushdown
ecryptfs: fasync BKL pushdown
Bluetooth VHCI: fasync BKL pushdown
tty_io: fasync BKL pushdown
tun: fasync BKL pushdown
i2o: fasync BKL pushdown
mpt: fasync BKL pushdown
Remove BKL from remote_llseek v2
Make FAT users happier by not deadlocking
x86-mce: BKL pushdown
vmwatchdog: BKL pushdown
vmcp: BKL pushdown
via-pmu: BKL pushdown
uml-random: BKL pushdown
uml-mmapper: BKL pushdown
...
Diffstat (limited to 'drivers/net/wan/cosa.c')
-rw-r--r-- | drivers/net/wan/cosa.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index b0fce1387eaf..5827324e9d9f 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -92,6 +92,7 @@ | |||
92 | #include <linux/spinlock.h> | 92 | #include <linux/spinlock.h> |
93 | #include <linux/mutex.h> | 93 | #include <linux/mutex.h> |
94 | #include <linux/device.h> | 94 | #include <linux/device.h> |
95 | #include <linux/smp_lock.h> | ||
95 | 96 | ||
96 | #undef COSA_SLOW_IO /* for testing purposes only */ | 97 | #undef COSA_SLOW_IO /* for testing purposes only */ |
97 | 98 | ||
@@ -970,15 +971,21 @@ static int cosa_open(struct inode *inode, struct file *file) | |||
970 | struct channel_data *chan; | 971 | struct channel_data *chan; |
971 | unsigned long flags; | 972 | unsigned long flags; |
972 | int n; | 973 | int n; |
974 | int ret = 0; | ||
973 | 975 | ||
976 | lock_kernel(); | ||
974 | if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) | 977 | if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) |
975 | >= nr_cards) | 978 | >= nr_cards) { |
976 | return -ENODEV; | 979 | ret = -ENODEV; |
980 | goto out; | ||
981 | } | ||
977 | cosa = cosa_cards+n; | 982 | cosa = cosa_cards+n; |
978 | 983 | ||
979 | if ((n=iminor(file->f_path.dentry->d_inode) | 984 | if ((n=iminor(file->f_path.dentry->d_inode) |
980 | & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) | 985 | & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) { |
981 | return -ENODEV; | 986 | ret = -ENODEV; |
987 | goto out; | ||
988 | } | ||
982 | chan = cosa->chan + n; | 989 | chan = cosa->chan + n; |
983 | 990 | ||
984 | file->private_data = chan; | 991 | file->private_data = chan; |
@@ -987,7 +994,8 @@ static int cosa_open(struct inode *inode, struct file *file) | |||
987 | 994 | ||
988 | if (chan->usage < 0) { /* in netdev mode */ | 995 | if (chan->usage < 0) { /* in netdev mode */ |
989 | spin_unlock_irqrestore(&cosa->lock, flags); | 996 | spin_unlock_irqrestore(&cosa->lock, flags); |
990 | return -EBUSY; | 997 | ret = -EBUSY; |
998 | goto out; | ||
991 | } | 999 | } |
992 | cosa->usage++; | 1000 | cosa->usage++; |
993 | chan->usage++; | 1001 | chan->usage++; |
@@ -996,7 +1004,9 @@ static int cosa_open(struct inode *inode, struct file *file) | |||
996 | chan->setup_rx = chrdev_setup_rx; | 1004 | chan->setup_rx = chrdev_setup_rx; |
997 | chan->rx_done = chrdev_rx_done; | 1005 | chan->rx_done = chrdev_rx_done; |
998 | spin_unlock_irqrestore(&cosa->lock, flags); | 1006 | spin_unlock_irqrestore(&cosa->lock, flags); |
999 | return 0; | 1007 | out: |
1008 | unlock_kernel(); | ||
1009 | return ret; | ||
1000 | } | 1010 | } |
1001 | 1011 | ||
1002 | static int cosa_release(struct inode *inode, struct file *file) | 1012 | static int cosa_release(struct inode *inode, struct file *file) |