From: Bryan O'Donoghue Date: Mon, 14 Sep 2015 09:48:41 +0000 (+0100) Subject: greybus: loopback: exit kfree after mutex release X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f3e0d17a3938ee253b6e6b7d16033121645b3a4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: loopback: exit kfree after mutex release init doesn't have a lock for kzalloc so exit shouldn't have lock with the corresponding kfree. Signed-off-by: Bryan O'Donoghue Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 7e1f527e3aef..745490af7e47 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -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 = {