diff --git a/drivers/of/property.c b/drivers/of/property.c index e1a2cb5ef401..b3f0285e401c 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1302,7 +1302,7 @@ static struct device_node *parse_remote_endpoint(struct device_node *np, int index) { /* Return NULL for index > 0 to signify end of remote-endpoints. */ - if (!index || strcmp(prop_name, "remote-endpoint")) + if (index > 0 || strcmp(prop_name, "remote-endpoint")) return NULL; return of_graph_get_remote_port_parent(np);