kernel-ark/drivers/usb/core
Alan Stern 0026e00523 USB: fix bug in initialization of interface minor numbers
Recent changes in the usbhid layer exposed a bug in usbcore.  If
CONFIG_USB_DYNAMIC_MINORS is enabled then an interface may be assigned
a minor number of 0.  However interfaces that aren't registered as USB
class devices also have their minor number set to 0, during
initialization.  As a result usb_find_interface() may return the
wrong interface, leading to a crash.

This patch (as1418) fixes the problem by initializing every
interface's minor number to -1.  It also cleans up the
usb_register_dev() function, which besides being somewhat awkwardly
written, does not unwind completely on all its error paths.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Philip J. Turmel <philip@turmel.org>
Tested-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Tested-by: Alex Riesen <raa.lkml@gmail.com>
Tested-by: Matthias Bayer <jackdachef@gmail.com>
CC: Jiri Kosina <jkosina@suse.cz>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-24 11:05:00 -07:00
..
buffer.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
config.c USB: remove the usb_host_ss_ep_comp structure 2010-05-20 13:21:40 -07:00
devices.c USB: devices: fix Coding Styles 2010-05-20 13:21:38 -07:00
devio.c USB-BKL: Convert usb_driver ioctl to unlocked_ioctl 2010-08-10 14:35:35 -07:00
driver.c USB: remove fake "address-of" expressions 2010-08-10 14:35:45 -07:00
endpoint.c USB: core endpoint: Fix Coding Styles 2010-08-10 14:35:34 -07:00
file.c USB: fix bug in initialization of interface minor numbers 2010-09-24 11:05:00 -07:00
generic.c USB: accept RNDIS configs if there's no alternative 2010-08-10 14:35:43 -07:00
hcd-pci.c USB: core: hcd-pci: use for_each_pci_dev() 2010-08-10 14:35:38 -07:00
hcd.c USB: xHCI: Supporting MSI/MSI-X 2010-08-10 14:35:40 -07:00
hub.c USB delay init quirk for logitech Harmony 700-series devices 2010-08-10 14:35:41 -07:00
inode.c USB-BKL: Remove lock_kernel in usbfs update_sb() 2010-08-10 14:35:35 -07:00
Kconfig USB: fix build on OMAPs if CONFIG_PM_RUNTIME is not set 2010-04-30 09:25:11 -07:00
Makefile
message.c USB: fix bug in initialization of interface minor numbers 2010-09-24 11:05:00 -07:00
notify.c
otg_whitelist.h
quirks.c USB delay init quirk for logitech Harmony 700-series devices 2010-08-10 14:35:41 -07:00
sysfs.c sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
urb.c USB: fix thread-unsafe anchor utiliy routines 2010-08-10 14:35:45 -07:00
usb.c USB: remove fake "address-of" expressions 2010-08-10 14:35:45 -07:00
usb.h