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

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