From bff751a2eb9ff8a40ac6f905cba3337b6f16db06 Mon Sep 17 00:00:00 2001 From: Dipesh Gandhi Date: Fri, 21 Apr 2017 09:22:24 +0530 Subject: [PATCH] ASoc: tegra-alt: fix coverity Change corrects: 1) Unsigned compared against 0 2) possible null pointer dereferencing. 3) Dereference before null check Bug 200192143 Change-Id: Ib005e3bb808fb12cb5f8ee6911bd3c522c879b00 Signed-off-by: Dipesh Gandhi Reviewed-on: http://git-master/r/1467216 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index a33613b9..1840e86c 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -1144,7 +1144,7 @@ static int tegra210_adsp_pcm_msg_handler(struct tegra210_adsp_app *app, switch (apm_msg->msg.call_params.method) { case nvfx_apm_method_set_position: - if (!prtd && !prtd->substream) + if (!prtd || !prtd->substream) return 0; runtime = prtd->substream->runtime; snd_pcm_period_elapsed(prtd->substream);