aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/devio.c16
-rw-r--r--drivers/usb/core/hcd-pci.c9
-rw-r--r--drivers/usb/core/inode.c2
-rw-r--r--drivers/usb/core/usb.h3
-rw-r--r--drivers/usb/host/isp116x-hcd.c3
-rw-r--r--drivers/usb/host/ohci-lh7a404.c2
-rw-r--r--drivers/usb/host/ohci-omap.c1
-rw-r--r--drivers/usb/host/ohci-s3c2410.c1
-rw-r--r--drivers/usb/input/hid-core.c3
-rw-r--r--drivers/usb/media/vicam.c4
-rw-r--r--drivers/usb/serial/generic.c2
11 files changed, 20 insertions, 26 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index b4265aa7d45e..487ff672b104 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -30,6 +30,8 @@
30 * Revision history 30 * Revision history
31 * 22.12.1999 0.1 Initial release (split from proc_usb.c) 31 * 22.12.1999 0.1 Initial release (split from proc_usb.c)
32 * 04.01.2000 0.2 Turned into its own filesystem 32 * 04.01.2000 0.2 Turned into its own filesystem
33 * 30.09.2005 0.3 Fix user-triggerable oops in async URB delivery
34 * (CAN-2005-3055)
33 */ 35 */
34 36
35/*****************************************************************************/ 37/*****************************************************************************/
@@ -58,7 +60,8 @@ static struct class *usb_device_class;
58struct async { 60struct async {
59 struct list_head asynclist; 61 struct list_head asynclist;
60 struct dev_state *ps; 62 struct dev_state *ps;
61 struct task_struct *task; 63 pid_t pid;
64 uid_t uid, euid;
62 unsigned int signr; 65 unsigned int signr;
63 unsigned int ifnum; 66 unsigned int ifnum;
64 void __user *userbuffer; 67 void __user *userbuffer;
@@ -290,7 +293,8 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
290 sinfo.si_errno = as->urb->status; 293 sinfo.si_errno = as->urb->status;
291 sinfo.si_code = SI_ASYNCIO; 294 sinfo.si_code = SI_ASYNCIO;
292 sinfo.si_addr = as->userurb; 295 sinfo.si_addr = as->userurb;
293 send_sig_info(as->signr, &sinfo, as->task); 296 kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid,
297 as->euid);
294 } 298 }
295 wake_up(&ps->wait); 299 wake_up(&ps->wait);
296} 300}
@@ -526,7 +530,9 @@ static int usbdev_open(struct inode *inode, struct file *file)
526 INIT_LIST_HEAD(&ps->async_completed); 530 INIT_LIST_HEAD(&ps->async_completed);
527 init_waitqueue_head(&ps->wait); 531 init_waitqueue_head(&ps->wait);
528 ps->discsignr = 0; 532 ps->discsignr = 0;
529 ps->disctask = current; 533 ps->disc_pid = current->pid;
534 ps->disc_uid = current->uid;
535 ps->disc_euid = current->euid;
530 ps->disccontext = NULL; 536 ps->disccontext = NULL;
531 ps->ifclaimed = 0; 537 ps->ifclaimed = 0;
532 wmb(); 538 wmb();
@@ -988,7 +994,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
988 as->userbuffer = NULL; 994 as->userbuffer = NULL;
989 as->signr = uurb->signr; 995 as->signr = uurb->signr;
990 as->ifnum = ifnum; 996 as->ifnum = ifnum;
991 as->task = current; 997 as->pid = current->pid;
998 as->uid = current->uid;
999 as->euid = current->euid;
992 if (!(uurb->endpoint & USB_DIR_IN)) { 1000 if (!(uurb->endpoint & USB_DIR_IN)) {
993 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { 1001 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) {
994 free_async(as); 1002 free_async(as);
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index cbb451d227d2..6385d1a99b60 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -242,7 +242,6 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
242 case HC_STATE_SUSPENDED: 242 case HC_STATE_SUSPENDED:
243 /* no DMA or IRQs except when HC is active */ 243 /* no DMA or IRQs except when HC is active */
244 if (dev->current_state == PCI_D0) { 244 if (dev->current_state == PCI_D0) {
245 free_irq (hcd->irq, hcd);
246 pci_save_state (dev); 245 pci_save_state (dev);
247 pci_disable_device (dev); 246 pci_disable_device (dev);
248 } 247 }
@@ -374,14 +373,6 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
374 373
375 hcd->state = HC_STATE_RESUMING; 374 hcd->state = HC_STATE_RESUMING;
376 hcd->saw_irq = 0; 375 hcd->saw_irq = 0;
377 retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,
378 hcd->irq_descr, hcd);
379 if (retval < 0) {
380 dev_err (hcd->self.controller,
381 "can't restore IRQ after resume!\n");
382 usb_hc_died (hcd);
383 return retval;
384 }
385 376
386 retval = hcd->driver->resume (hcd); 377 retval = hcd->driver->resume (hcd);
387 if (!HC_IS_RUNNING (hcd->state)) { 378 if (!HC_IS_RUNNING (hcd->state)) {
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 640f41e47029..d07bba01995b 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -713,7 +713,7 @@ void usbfs_remove_device(struct usb_device *dev)
713 sinfo.si_errno = EPIPE; 713 sinfo.si_errno = EPIPE;
714 sinfo.si_code = SI_ASYNCIO; 714 sinfo.si_code = SI_ASYNCIO;
715 sinfo.si_addr = ds->disccontext; 715 sinfo.si_addr = ds->disccontext;
716 send_sig_info(ds->discsignr, &sinfo, ds->disctask); 716 kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid);
717 } 717 }
718 } 718 }
719 usbfs_update_special(); 719 usbfs_update_special();
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 83d48c8133af..e6504f3370ad 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -52,7 +52,8 @@ struct dev_state {
52 struct list_head async_completed; 52 struct list_head async_completed;
53 wait_queue_head_t wait; /* wake up if a request completed */ 53 wait_queue_head_t wait; /* wake up if a request completed */
54 unsigned int discsignr; 54 unsigned int discsignr;
55 struct task_struct *disctask; 55 pid_t disc_pid;
56 uid_t disc_uid, disc_euid;
56 void __user *disccontext; 57 void __user *disccontext;
57 unsigned long ifclaimed; 58 unsigned long ifclaimed;
58}; 59};
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 41bbae83fc71..e142056b0d2c 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -326,7 +326,8 @@ static void postproc_atl_queue(struct isp116x *isp116x)
326 usb_settoggle(udev, ep->epnum, 326 usb_settoggle(udev, ep->epnum,
327 ep->nextpid == 327 ep->nextpid ==
328 USB_PID_OUT, 328 USB_PID_OUT,
329 PTD_GET_TOGGLE(ptd) ^ 1); 329 PTD_GET_TOGGLE(ptd));
330 urb->actual_length += PTD_GET_COUNT(ptd);
330 urb->status = cc_to_error[TD_DATAUNDERRUN]; 331 urb->status = cc_to_error[TD_DATAUNDERRUN];
331 spin_unlock(&urb->lock); 332 spin_unlock(&urb->lock);
332 continue; 333 continue;
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c
index 817620d73841..859aca7be753 100644
--- a/drivers/usb/host/ohci-lh7a404.c
+++ b/drivers/usb/host/ohci-lh7a404.c
@@ -17,8 +17,6 @@
17 */ 17 */
18 18
19#include <asm/hardware.h> 19#include <asm/hardware.h>
20#include <asm/mach-types.h>
21#include <asm/arch/hardware.h>
22 20
23 21
24extern int usb_disabled(void); 22extern int usb_disabled(void);
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 5cde76faab93..d8f3ba7ad52e 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -18,7 +18,6 @@
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20 20
21#include <asm/arch/hardware.h>
22#include <asm/arch/mux.h> 21#include <asm/arch/mux.h>
23#include <asm/arch/irqs.h> 22#include <asm/arch/irqs.h>
24#include <asm/arch/gpio.h> 23#include <asm/arch/gpio.h>
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index 3d9bcf78a9a4..da7d5478f74d 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -20,7 +20,6 @@
20*/ 20*/
21 21
22#include <asm/hardware.h> 22#include <asm/hardware.h>
23#include <asm/mach-types.h>
24#include <asm/hardware/clock.h> 23#include <asm/hardware/clock.h>
25#include <asm/arch/usb-control.h> 24#include <asm/arch/usb-control.h>
26 25
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index a99865c689c5..41f92b924761 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1702,10 +1702,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1702 if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint */ 1702 if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint */
1703 continue; 1703 continue;
1704 1704
1705 /* handle potential highspeed HID correctly */
1706 interval = endpoint->bInterval; 1705 interval = endpoint->bInterval;
1707 if (dev->speed == USB_SPEED_HIGH)
1708 interval = 1 << (interval - 1);
1709 1706
1710 /* Change the polling interval of mice. */ 1707 /* Change the polling interval of mice. */
1711 if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) 1708 if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0)
diff --git a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
index 4a5857c53f11..0bc0b1247a6b 100644
--- a/drivers/usb/media/vicam.c
+++ b/drivers/usb/media/vicam.c
@@ -1148,7 +1148,7 @@ vicam_write_proc_gain(struct file *file, const char *buffer,
1148static void 1148static void
1149vicam_create_proc_root(void) 1149vicam_create_proc_root(void)
1150{ 1150{
1151 vicam_proc_root = create_proc_entry("video/vicam", S_IFDIR, 0); 1151 vicam_proc_root = proc_mkdir("video/vicam", NULL);
1152 1152
1153 if (vicam_proc_root) 1153 if (vicam_proc_root)
1154 vicam_proc_root->owner = THIS_MODULE; 1154 vicam_proc_root->owner = THIS_MODULE;
@@ -1181,7 +1181,7 @@ vicam_create_proc_entry(struct vicam_camera *cam)
1181 1181
1182 sprintf(name, "video%d", cam->vdev.minor); 1182 sprintf(name, "video%d", cam->vdev.minor);
1183 1183
1184 cam->proc_dir = create_proc_entry(name, S_IFDIR, vicam_proc_root); 1184 cam->proc_dir = proc_mkdir(name, vicam_proc_root);
1185 1185
1186 if ( !cam->proc_dir ) 1186 if ( !cam->proc_dir )
1187 return; // FIXME: We should probably return an error here 1187 return; // FIXME: We should probably return an error here
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index ddde5fb13f6b..5f7d3193d355 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -223,7 +223,7 @@ int usb_serial_generic_write_room (struct usb_serial_port *port)
223 dbg("%s - port %d", __FUNCTION__, port->number); 223 dbg("%s - port %d", __FUNCTION__, port->number);
224 224
225 if (serial->num_bulk_out) { 225 if (serial->num_bulk_out) {
226 if (port->write_urb_busy) 226 if (!(port->write_urb_busy))
227 room = port->bulk_out_size; 227 room = port->bulk_out_size;
228 } 228 }
229 229