]> git.baikalelectronics.ru Git - kernel.git/commit
USB: check for hub driver not bound to root hub device
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 22 Jul 2009 18:41:18 +0000 (14:41 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Sep 2009 13:46:30 +0000 (06:46 -0700)
commit4344042dd9eca62d73a170567a53c72c2b2d7eef
treeeb5be3e297ff1c3b12b555fb80d391f9706702f1
parentafd53c5af856f49ade5291b2197d17a45ca46d47
USB: check for hub driver not bound to root hub device

This patch (as1267) changes usb_kick_khubd() and hdev_to_hub() to make
them more resilient against situations where a hub device isn't bound
to the hub driver.  The code assumes that if a root hub was
successfully registered then it must be bound to the hub driver.

But this assumption can fail if the user manually unbinds the hub
driver, or more importantly, if the host controller dies causing
usb_set_configuration to fail.

To protect against these possibilities, make hdev_to_hub() check that
the hub device is configured before dereferencing the active
configuration, and make usb_kick_khubd() check that the pointer to the
hub's private data structure isn't NULL.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hub.c