From: Vaibhav Agarwal Date: Mon, 23 May 2016 18:01:14 +0000 (+0530) Subject: greybus: audio: Fix memory leak X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=37f07c0c974d78bfcdc9f3267438c91163fc3ae5;p=linux-beck.git 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 --- 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);