greybus: Use valid control pointer while freeing memory
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Tue, 16 Aug 2016 07:06:51 +0000 (12:36 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 18 Aug 2016 15:32:39 +0000 (17:32 +0200)
While releasing memory during error path exit, invalid memory pointer
was used for dapm_routes. Use a valid one.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_topology.c

index 5c5b813..e54078a 100644 (file)
@@ -1317,7 +1317,7 @@ static int gbaudio_tplg_process_routes(struct gbaudio_module_info *module,
        return 0;
 
 error:
-       devm_kfree(module->dev, dapm_routes);
+       devm_kfree(module->dev, module->dapm_routes);
        return ret;
 }