From a69f76993dfe5f43d3e6c4b2bcfbaacf2c247d6e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 17 Apr 2019 22:57:00 +0200 Subject: [PATCH v2 3/3] usb: roles: Check for NULL con_id When usb_role_switch_match gets called by device_connection_find_match because of a fwnode_reference matching the con_id passed to device_connection_find_match, then con->id will be NULL and in this case we do not need to check it since our caller has already checked it. Signed-off-by: Hans de Goede --- drivers/usb/roles/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c index f45d8df5cfb8..86defca6623e 100644 --- a/drivers/usb/roles/class.c +++ b/drivers/usb/roles/class.c @@ -101,7 +101,7 @@ static void *usb_role_switch_match(struct device_connection *con, int ep, struct device *dev; if (con->fwnode) { - if (!fwnode_property_present(con->fwnode, con->id)) + if (con->id && !fwnode_property_present(con->fwnode, con->id)) return NULL; dev = class_find_device(role_class, NULL, con->fwnode, -- 2.21.0