From b29699602df46a8dffe01bedf2a601c4e2699a96 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Tue, 28 Oct 2014 19:35:58 -0500 Subject: [PATCH] greybus: drop the cport id on error In gb_connection_create(), if an error occurs adding a connection's device, the cport id assigned to the AP end of the connection is not getting freed. Fix that. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 69ea3a788771..3fee64773976 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -186,6 +186,8 @@ struct gb_connection *gb_connection_create(struct gb_interface *interface, retval = device_add(&connection->dev); if (retval) { + gb_connection_hd_cport_id_free(connection); + /* kref_put(connection->hd); */ kfree(connection); return NULL; } -- 2.39.2