Commit e86905b6 authored by Marti Bolivar's avatar Marti Bolivar Committed by Greg Kroah-Hartman

greybus: gb_hd_connection_find(): fix "not found" case

Without this, null-testing the return value of this function is
broken.
Signed-off-by: default avatarMarti Bolivar <mbolivar@leaflabs.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 7a13e2f6
......@@ -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;
......
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