diff options
Diffstat (limited to 'drivers/staging/greybus/manifest.c')
-rw-r--r-- | drivers/staging/greybus/manifest.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c index 72400e38b392..2d470500222e 100644 --- a/drivers/staging/greybus/manifest.c +++ b/drivers/staging/greybus/manifest.c @@ -228,6 +228,7 @@ static char *gb_string_get(struct gb_interface *intf, u8 string_id) */ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle) { + struct gb_connection *connection; struct gb_interface *intf = bundle->intf; struct manifest_desc *desc; struct manifest_desc *next; @@ -235,6 +236,7 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle) u8 protocol_id; u16 cport_id; u32 count = 0; + int ret; /* Set up all cport descriptors associated with this bundle */ list_for_each_entry_safe(desc, next, &intf->manifest_descs, links) { @@ -254,10 +256,18 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle) /* Found one. Set up its function structure */ protocol_id = desc_cport->protocol_id; - if (!gb_connection_create_dynamic(intf, bundle, cport_id, - protocol_id)) + connection = gb_connection_create_dynamic(intf, bundle, + cport_id, + protocol_id); + if (!connection) goto exit; + ret = gb_connection_init(connection); + if (ret) { + gb_connection_destroy(connection); + goto exit; + } + count++; /* Release the cport descriptor */ |