aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-14 09:04:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-14 09:04:36 +0100
commitfbd533e90d239e17d9427a6481ae60be25680cb7 (patch)
tree72f5b36af33981605eecf92da1516b9b4c37d5a6 /drivers/usb/core
parentarm64: dts: qcom: sc7280: Set the default dr_mode for usb2 (diff)
parentLinux 5.17-rc4 (diff)
downloadlinux-dev-fbd533e90d239e17d9427a6481ae60be25680cb7.tar.xz
linux-dev-fbd533e90d239e17d9427a6481ae60be25680cb7.zip
Merge 5.17-rc4 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/port.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index c2bbf97a79be..d5bc36ca5b1f 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -602,11 +602,14 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1)
return retval;
}
- find_and_link_peer(hub, port1);
-
retval = component_add(&port_dev->dev, &connector_ops);
- if (retval)
+ if (retval) {
dev_warn(&port_dev->dev, "failed to add component\n");
+ device_unregister(&port_dev->dev);
+ return retval;
+ }
+
+ find_and_link_peer(hub, port1);
/*
* Enable runtime pm and hold a refernce that hub_configure()