greybus: connection: free resources properly on failures

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Viresh Kumar 2014-11-13 18:14:39 +05:30 committed by Greg Kroah-Hartman
parent b97c46ecaf
commit a68bd742c0

View File

@ -199,6 +199,7 @@ struct gb_connection *gb_connection_create(struct gb_interface *interface,
gb_connection_hd_cport_id_free(connection);
gb_protocol_put(connection->protocol);
put_device(&connection->dev);
kfree(connection);
return NULL;
}