ASoC: tegra-alt: Fix ADSP crash at set_params
Arun Shamanna Lakshmi [Tue, 10 Mar 2015 20:49:41 +0000 (13:49 -0700)]
Set the plugin params only if ADSP is booted and plugin
is loaded

Bug 200075850

Change-Id: Ib174afe270357ae3c21e50b9e0e85348024ec681
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/715944

sound/soc/tegra-alt/tegra210_adsp_alt.c

index 1c1e6a7..e6a68d3 100644 (file)
@@ -2217,6 +2217,11 @@ static int tegra210_adsp_set_param(struct snd_kcontrol *kcontrol,
        struct tegra210_adsp_app *app = &adsp->apps[params->base];
        apm_msg_t apm_msg;
 
+       if (!adsp->init_done) {
+               dev_warn(adsp->dev, "ADSP is not booted yet\n");
+               return 0;
+       }
+
        if (!app->plugin) {
                dev_warn(adsp->dev, "Plugin not yet initialized\n");
                return 0;