From: Alan Stern Date: Tue, 21 Sep 2010 19:01:53 +0000 (-0400) Subject: USB: fix bug in initialization of interface minor numbers X-Git-Tag: v2.6.36-rc6~37^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0026e00523a85b90a92a93ddf6660939ecef3e54;p=pandora-kernel.git 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 Tested-by: Philip J. Turmel Tested-by: Gabriel Craciunescu Tested-by: Alex Riesen Tested-by: Matthias Bayer CC: Jiri Kosina Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed