OSDN Git Service

greybus: connection: Destroy wq on failure
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 13 Aug 2015 05:05:29 +0000 (10:35 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 14 Aug 2015 02:19:31 +0000 (19:19 -0700)
Need to destroy the wq created earlier, do it.

Fixes: d0f1778a6b67 ("greybus/connection: add a timestamp kfifo to track connection handoff")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c

index 27b64d6..d0f499d 100644 (file)
@@ -252,7 +252,7 @@ gb_connection_create_range(struct greybus_host_device *hd,
 
        if (kfifo_alloc(&connection->ts_kfifo, GB_CONNECTION_TS_KFIFO_LEN,
                        GFP_KERNEL))
-               goto err_free_connection;
+               goto err_destroy_wq;
 
        connection->dev.parent = parent;
        connection->dev.bus = &greybus_bus_type;
@@ -298,6 +298,8 @@ gb_connection_create_range(struct greybus_host_device *hd,
 
 err_free_kfifo:
        kfifo_free(&connection->ts_kfifo);
+err_destroy_wq:
+       destroy_workqueue(connection->wq);
 err_free_connection:
        kfree(connection);
 err_remove_ida: