greybus: svc: flush workqueue at connection exit
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Dec 2015 16:29:00 +0000 (17:29 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 3 Dec 2015 23:38:54 +0000 (15:38 -0800)
Make sure to flush the workqueue from hotplug and hotunplug events when
the svc connection is tore down.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/svc.c

index af41e8e49c3101e8804a9798053edaa4e424b57d..f65aba6446e2c072a7bdef13ca946d4f3405f10d 100644 (file)
@@ -709,6 +709,8 @@ static void gb_svc_connection_exit(struct gb_connection *connection)
        if (device_is_registered(&svc->dev))
                device_del(&svc->dev);
 
+       flush_workqueue(svc->wq);
+
        connection->hd->svc = NULL;
        connection->private = NULL;