greybus: audio_codec: Free gccodec on codec probe failure
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 27 Jan 2016 05:46:57 +0000 (11:16 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 28 Jan 2016 01:34:54 +0000 (17:34 -0800)
We aren't freeing the codec, that we allocated before failing to probe
the connection. Free it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_codec.c

index 1f39c9cd1aee583c83d3496c446f88101264f5e0..a7ccaaad5281709e65ff413593c70265873fc135 100644 (file)
@@ -713,6 +713,7 @@ topology_error:
        kfree(topology);
 base_error:
        gbcodec->mgmt_connection = NULL;
+       gbaudio_free_codec(dev, gbcodec);
        return ret;
 }