diff options
Diffstat (limited to 'drivers/usb/mon/mon_bin.c')
| -rw-r--r-- | drivers/usb/mon/mon_bin.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 61c76b13f0f1..44cb37b5a4dc 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
| @@ -646,17 +646,14 @@ static int mon_bin_open(struct inode *inode, struct file *file) | |||
| 646 | size_t size; | 646 | size_t size; |
| 647 | int rc; | 647 | int rc; |
| 648 | 648 | ||
| 649 | lock_kernel(); | ||
| 650 | mutex_lock(&mon_lock); | 649 | mutex_lock(&mon_lock); |
| 651 | if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) { | 650 | if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) { |
| 652 | mutex_unlock(&mon_lock); | 651 | mutex_unlock(&mon_lock); |
| 653 | unlock_kernel(); | ||
| 654 | return -ENODEV; | 652 | return -ENODEV; |
| 655 | } | 653 | } |
| 656 | if (mbus != &mon_bus0 && mbus->u_bus == NULL) { | 654 | if (mbus != &mon_bus0 && mbus->u_bus == NULL) { |
| 657 | printk(KERN_ERR TAG ": consistency error on open\n"); | 655 | printk(KERN_ERR TAG ": consistency error on open\n"); |
| 658 | mutex_unlock(&mon_lock); | 656 | mutex_unlock(&mon_lock); |
| 659 | unlock_kernel(); | ||
| 660 | return -ENODEV; | 657 | return -ENODEV; |
| 661 | } | 658 | } |
| 662 | 659 | ||
| @@ -689,7 +686,6 @@ static int mon_bin_open(struct inode *inode, struct file *file) | |||
| 689 | 686 | ||
| 690 | file->private_data = rp; | 687 | file->private_data = rp; |
| 691 | mutex_unlock(&mon_lock); | 688 | mutex_unlock(&mon_lock); |
| 692 | unlock_kernel(); | ||
| 693 | return 0; | 689 | return 0; |
| 694 | 690 | ||
| 695 | err_allocbuff: | 691 | err_allocbuff: |
| @@ -698,7 +694,6 @@ err_allocvec: | |||
| 698 | kfree(rp); | 694 | kfree(rp); |
| 699 | err_alloc: | 695 | err_alloc: |
| 700 | mutex_unlock(&mon_lock); | 696 | mutex_unlock(&mon_lock); |
| 701 | unlock_kernel(); | ||
| 702 | return rc; | 697 | return rc; |
| 703 | } | 698 | } |
| 704 | 699 | ||
| @@ -954,7 +949,7 @@ static int mon_bin_queued(struct mon_reader_bin *rp) | |||
| 954 | 949 | ||
| 955 | /* | 950 | /* |
| 956 | */ | 951 | */ |
| 957 | static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 952 | static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
| 958 | { | 953 | { |
| 959 | struct mon_reader_bin *rp = file->private_data; | 954 | struct mon_reader_bin *rp = file->private_data; |
| 960 | // struct mon_bus* mbus = rp->r.m_bus; | 955 | // struct mon_bus* mbus = rp->r.m_bus; |
| @@ -1009,7 +1004,7 @@ static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 1009 | 1004 | ||
| 1010 | mutex_lock(&rp->fetch_lock); | 1005 | mutex_lock(&rp->fetch_lock); |
| 1011 | spin_lock_irqsave(&rp->b_lock, flags); | 1006 | spin_lock_irqsave(&rp->b_lock, flags); |
| 1012 | mon_free_buff(rp->b_vec, size/CHUNK_SIZE); | 1007 | mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE); |
| 1013 | kfree(rp->b_vec); | 1008 | kfree(rp->b_vec); |
| 1014 | rp->b_vec = vec; | 1009 | rp->b_vec = vec; |
| 1015 | rp->b_size = size; | 1010 | rp->b_size = size; |
| @@ -1094,19 +1089,6 @@ static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 1094 | return ret; | 1089 | return ret; |
| 1095 | } | 1090 | } |
| 1096 | 1091 | ||
| 1097 | static long mon_bin_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
| 1098 | unsigned long arg) | ||
| 1099 | { | ||
| 1100 | int ret; | ||
| 1101 | |||
| 1102 | lock_kernel(); | ||
| 1103 | ret = mon_bin_ioctl(file, cmd, arg); | ||
| 1104 | unlock_kernel(); | ||
| 1105 | |||
| 1106 | return ret; | ||
| 1107 | } | ||
| 1108 | |||
| 1109 | |||
| 1110 | #ifdef CONFIG_COMPAT | 1092 | #ifdef CONFIG_COMPAT |
| 1111 | static long mon_bin_compat_ioctl(struct file *file, | 1093 | static long mon_bin_compat_ioctl(struct file *file, |
| 1112 | unsigned int cmd, unsigned long arg) | 1094 | unsigned int cmd, unsigned long arg) |
| @@ -1250,7 +1232,7 @@ static const struct file_operations mon_fops_binary = { | |||
| 1250 | .read = mon_bin_read, | 1232 | .read = mon_bin_read, |
| 1251 | /* .write = mon_text_write, */ | 1233 | /* .write = mon_text_write, */ |
| 1252 | .poll = mon_bin_poll, | 1234 | .poll = mon_bin_poll, |
| 1253 | .unlocked_ioctl = mon_bin_unlocked_ioctl, | 1235 | .unlocked_ioctl = mon_bin_ioctl, |
| 1254 | #ifdef CONFIG_COMPAT | 1236 | #ifdef CONFIG_COMPAT |
| 1255 | .compat_ioctl = mon_bin_compat_ioctl, | 1237 | .compat_ioctl = mon_bin_compat_ioctl, |
| 1256 | #endif | 1238 | #endif |
