greybus: connection: free resources properly on failures
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 13 Nov 2014 12:44:39 +0000 (18:14 +0530)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 14 Nov 2014 21:18:26 +0000 (13:18 -0800)
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>
drivers/staging/greybus/connection.c

index 5373f44..32f1ec5 100644 (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;
        }