]> git.baikalelectronics.ru Git - kernel.git/commit
usbcore: Fix wrong device in an error message in hub_port_connect()
authorTakashi Iwai <tiwai@suse.de>
Tue, 19 Aug 2014 15:37:55 +0000 (17:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Aug 2014 16:16:08 +0000 (11:16 -0500)
commit0c37800c1b3d54a8ed2557e88f16997255d26fdc
treef8dc50c8a83d4d97a210bd306fee3fb73f1515db
parentf45f9587f1dd1e89dd1c89561c9572f777c5bcb7
usbcore: Fix wrong device in an error message in hub_port_connect()

The commit [b7441ee11e0f: usbcore: don't log on consecutive debounce
failures of the same port] added the check of the reliable port, but
it also replaced the device argument to dev_err() wrongly, which leads
to a NULL dereference.

This patch restores the right device, port_dev->dev.  Also, since
dev_err() itself shows the port number, reduce the port number shown
in the error message, essentially reverting to the state before the
commit b7441ee11e0f.

[The fix suggested by Hannes, and the error message cleanup suggested
 by Alan Stern]

Fixes: b7441ee11e0f ('usbcore: don't log on consecutive debounce failures of the same port')
Reported-by: Hannes Reinecke <hare@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c