From: Alex Elder Date: Wed, 29 Oct 2014 00:35:58 +0000 (-0500) Subject: greybus: drop the cport id on error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b29699602df46a8dffe01bedf2a601c4e2699a96;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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; }