diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 449ae34bf531..07a593d2cbd1 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -56,8 +56,10 @@ struct gb_connection *gb_hd_connection_find(struct greybus_host_device *hd, else if (connection->hd_cport_id < cport_id) node = node->rb_right; else - break; + goto found; } + connection = NULL; + found: spin_unlock_irq(&gb_connections_lock); return connection;