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

Without this, null-testing the return value of this function is
broken.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Marti Bolivar 2014-10-06 13:26:02 -04:00 committed by Greg Kroah-Hartman
parent 7a13e2f688
commit e86905b6cd

View file

@ -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;