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 <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1467216
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This commit is contained in:
Dipesh Gandhi
2017-04-21 09:22:24 +05:30
committed by Sameer Pujar
parent 9bdf181610
commit bff751a2eb

View File

@@ -1144,7 +1144,7 @@ static int tegra210_adsp_pcm_msg_handler(struct tegra210_adsp_app *app,
switch (apm_msg->msg.call_params.method) { switch (apm_msg->msg.call_params.method) {
case nvfx_apm_method_set_position: case nvfx_apm_method_set_position:
if (!prtd && !prtd->substream) if (!prtd || !prtd->substream)
return 0; return 0;
runtime = prtd->substream->runtime; runtime = prtd->substream->runtime;
snd_pcm_period_elapsed(prtd->substream); snd_pcm_period_elapsed(prtd->substream);