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 <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Alex Elder 2014-10-28 19:35:58 -05:00 committed by Greg Kroah-Hartman
parent 755a21a9bf
commit b29699602d
1 changed files with 2 additions and 0 deletions

View File

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