Commit 147ab537 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Greg Kroah-Hartman

usb: typec: Don't try to register component master without components

This fixes NULL pointer dereference that happens if
component master is registered with empty component match
list.

Fixes: 730b49aa ("usb: typec: port-mapper: Convert to the component framework")
Reported-by: default avatarMikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20220124090228.41396-3-heikki.krogerus@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7817adb0
......@@ -60,6 +60,8 @@ int typec_link_ports(struct typec_port *con)
return 0;
bus_for_each_dev(&acpi_bus_type, NULL, &arg, typec_port_match);
if (!arg.match)
return 0;
/*
* REVISIT: Now each connector can have only a single component master.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment