]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
tegra-alt:adsp: NULL check for app variable
authorViswanath L <viswanathl@nvidia.com>
Fri, 28 Oct 2016 07:46:39 +0000 (13:16 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 16 Nov 2016 09:40:53 +0000 (01:40 -0800)
ADSP app variables are not initialized in all cases (like at APM
output pin) causing NULL pointer access to app->override_freq_work

NULL check fixes this; override_freq_work will get called at widget
ON event

Bug 200245012

Change-Id: Ie6161c0247d8b15db88bdef706ab6c3b472fa977
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1244336
(cherry picked from commit 6f6c38a0413b20111ff95d3e0d26c631f0a7a639)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1252706
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
sound/soc/tegra-alt/tegra210_adsp_alt.c

index 22b3525827f0690090810a48141fc470ca960b93..dee016740cd40a1aa21ec5945e7b013b24c0c6dd 100644 (file)
@@ -654,7 +654,7 @@ static int tegra210_adsp_send_state_msg(struct tegra210_adsp_app *app,
 
        /* Spike ADSP freq to max when app transitions to active */
        /* state; DFS will thereafter find appropriate rate      */
-       if (state == nvfx_state_active)
+       if ((state == nvfx_state_active) && (app->override_freq_work != NULL))
                schedule_work(app->override_freq_work);
 
        return tegra210_adsp_send_msg(app, &apm_msg, flags);