greybus: loopback: exit kfree after mutex release
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 14 Sep 2015 09:48:41 +0000 (10:48 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 15 Sep 2015 04:35:58 +0000 (21:35 -0700)
init doesn't have a lock for kzalloc so exit shouldn't have lock with the
corresponding kfree.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c

index 7e1f527..745490a 100644 (file)
@@ -955,8 +955,8 @@ static void gb_loopback_connection_exit(struct gb_connection *connection)
        sysfs_remove_groups(&connection->dev.kobj, loopback_con_groups);
        debugfs_remove(gb->file);
        list_del(&gb->entry);
-       kfree(gb);
        mutex_unlock(&gb_dev.mutex);
+       kfree(gb);
 }
 
 static struct gb_protocol loopback_protocol = {