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:
parent
755a21a9bf
commit
b29699602d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue