aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-08-19 11:37:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-19 12:16:08 -0400
commitdd5f5006d1035547559c8a90781a7e249787a7a2 (patch)
treef8dc50c8a83d4d97a210bd306fee3fb73f1515db /drivers/usb
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
usbcore: Fix wrong device in an error message in hub_port_connect()
The commit [5ee0f803cc3a: 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 5ee0f803cc3a. [The fix suggested by Hannes, and the error message cleanup suggested by Alan Stern] Fixes: 5ee0f803cc3a ('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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 8a4dcbc7a75f..e0eaeb8697bb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4631,9 +4631,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
4631 if (status != -ENODEV && 4631 if (status != -ENODEV &&
4632 port1 != unreliable_port && 4632 port1 != unreliable_port &&
4633 printk_ratelimit()) 4633 printk_ratelimit())
4634 dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n", 4634 dev_err(&port_dev->dev, "connect-debounce failed\n");
4635 port1);
4636
4637 portstatus &= ~USB_PORT_STAT_CONNECTION; 4635 portstatus &= ~USB_PORT_STAT_CONNECTION;
4638 unreliable_port = port1; 4636 unreliable_port = port1;
4639 } else { 4637 } else {