aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/audio_module.c
diff options
context:
space:
mode:
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>2016-05-23 23:31:14 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-23 14:41:41 -0700
commit37f07c0c974d78bfcdc9f3267438c91163fc3ae5 (patch)
tree066fdc0786b1ba6dc42291c680740a05ae7f8700 /drivers/staging/greybus/audio_module.c
parentgreybus: legacy: remove protocol.o from the makefile (diff)
downloadlinux-dev-37f07c0c974d78bfcdc9f3267438c91163fc3ae5.tar.xz
linux-dev-37f07c0c974d78bfcdc9f3267438c91163fc3ae5.zip
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 <vaibhav.agarwal@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/audio_module.c')
-rw-r--r--drivers/staging/greybus/audio_module.c2
1 files changed, 1 insertions, 1 deletions
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);