From 37f07c0c974d78bfcdc9f3267438c91163fc3ae5 Mon Sep 17 00:00:00 2001 From: Vaibhav Agarwal Date: Mon, 23 May 2016 23:31:14 +0530 Subject: [PATCH] greybus: audio: Fix memory leak Topology data pointer was mistakenly set to NULL before freeing it. Fix this. Fixes: 64a86d9ba850 ("audio: Add module specific driver") Signed-off-by: Vaibhav Agarwal Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index 57d3b0292231..53e84f5fafb0 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -368,8 +368,8 @@ static void gb_audio_disconnect(struct gb_bundle *bundle) gbaudio_unregister_module(gbmodule); gbaudio_tplg_release(gbmodule); - gbmodule->topology = NULL; kfree(gbmodule->topology); + gbmodule->topology = NULL; gb_connection_disable(gbmodule->mgmt_connection); list_for_each_entry_safe(dai, _dai, &gbmodule->data_list, list) { gb_connection_disable(dai->connection);