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/input/mousedev.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/input/mousedev.c')
-rw-r--r-- | drivers/input/mousedev.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index b989748598ae..8137e50ded87 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #define MOUSEDEV_MIX 31 | 14 | #define MOUSEDEV_MIX 31 |
15 | 15 | ||
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/smp_lock.h> | ||
17 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/init.h> | 20 | #include <linux/init.h> |
@@ -545,16 +546,21 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
545 | if (i >= MOUSEDEV_MINORS) | 546 | if (i >= MOUSEDEV_MINORS) |
546 | return -ENODEV; | 547 | return -ENODEV; |
547 | 548 | ||
549 | lock_kernel(); | ||
548 | error = mutex_lock_interruptible(&mousedev_table_mutex); | 550 | error = mutex_lock_interruptible(&mousedev_table_mutex); |
549 | if (error) | 551 | if (error) { |
552 | unlock_kernel(); | ||
550 | return error; | 553 | return error; |
554 | } | ||
551 | mousedev = mousedev_table[i]; | 555 | mousedev = mousedev_table[i]; |
552 | if (mousedev) | 556 | if (mousedev) |
553 | get_device(&mousedev->dev); | 557 | get_device(&mousedev->dev); |
554 | mutex_unlock(&mousedev_table_mutex); | 558 | mutex_unlock(&mousedev_table_mutex); |
555 | 559 | ||
556 | if (!mousedev) | 560 | if (!mousedev) { |
561 | unlock_kernel(); | ||
557 | return -ENODEV; | 562 | return -ENODEV; |
563 | } | ||
558 | 564 | ||
559 | client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL); | 565 | client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL); |
560 | if (!client) { | 566 | if (!client) { |
@@ -573,6 +579,7 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
573 | goto err_free_client; | 579 | goto err_free_client; |
574 | 580 | ||
575 | file->private_data = client; | 581 | file->private_data = client; |
582 | unlock_kernel(); | ||
576 | return 0; | 583 | return 0; |
577 | 584 | ||
578 | err_free_client: | 585 | err_free_client: |
@@ -580,6 +587,7 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
580 | kfree(client); | 587 | kfree(client); |
581 | err_put_mousedev: | 588 | err_put_mousedev: |
582 | put_device(&mousedev->dev); | 589 | put_device(&mousedev->dev); |
590 | unlock_kernel(); | ||
583 | return error; | 591 | return error; |
584 | } | 592 | } |
585 | 593 | ||