summaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 23:48:31 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 23:48:31 +0200
commitd1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch)
tree5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/block/paride/pt.c
parentftrace: document updates (diff)
parentMerge commit 'v2.6.26' into bkl-removal (diff)
downloadlinux-d1794f2c5b5817eb79ccc5e00701ca748d1b073a.tar.xz
linux-d1794f2c5b5817eb79ccc5e00701ca748d1b073a.zip
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/block/paride/pt.c')
-rw-r--r--drivers/block/paride/pt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 27455ee1e9da..5c74c3574a5a 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -650,8 +650,11 @@ static int pt_open(struct inode *inode, struct file *file)
struct pt_unit *tape = pt + unit;
int err;
- if (unit >= PT_UNITS || (!tape->present))
+ lock_kernel();
+ if (unit >= PT_UNITS || (!tape->present)) {
+ unlock_kernel();
return -ENODEV;
+ }
err = -EBUSY;
if (!atomic_dec_and_test(&tape->available))
@@ -678,10 +681,12 @@ static int pt_open(struct inode *inode, struct file *file)
}
file->private_data = tape;
+ unlock_kernel();
return 0;
out:
atomic_inc(&tape->available);
+ unlock_kernel();
return err;
}