summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorMarti Bolivar2014-10-06 19:26:02 +0200
committerGreg Kroah-Hartman2014-10-06 19:39:06 +0200
commite86905b6cd73ce62af88b3526dbc10c14d47016d (patch)
tree42f48a67e4a7530a0cc6329d960b77a03e52eeb5 /drivers/staging/greybus/connection.c
parentgreybus: fix manifest parsing problem with descriptor payload (diff)
downloadkernel-qcow2-linux-e86905b6cd73ce62af88b3526dbc10c14d47016d.tar.gz
kernel-qcow2-linux-e86905b6cd73ce62af88b3526dbc10c14d47016d.tar.xz
kernel-qcow2-linux-e86905b6cd73ce62af88b3526dbc10c14d47016d.zip
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>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c4
1 files changed, 3 insertions, 1 deletions
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;