ASoC: msm: qdsp6v2: set pointer to NULL after free.

Pointer after kfree is not sanitized.
Set pointer to NULL.

CRs-Fixed: 2008031
Change-Id: Ia59a57fcd142a6ed18d168992b8da4019314afa4
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Signed-off-by: Bikshapathi Kothapeta <bkotha@codeaurora.org>
This commit is contained in:
Xiaojun Sang 2017-02-24 16:13:20 +08:00 committed by Flex1911
parent 1feb1d1e7c
commit b293354c82
3 changed files with 5 additions and 0 deletions

View file

@ -396,6 +396,7 @@ done:
mutex_unlock(&prtd->lock);
prtd->prepared--;
kfree(prtd);
runtime->private_data = NULL;
return 0;
}
static int msm_afe_prepare(struct snd_pcm_substream *substream)

View file

@ -391,6 +391,7 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
pr_debug("%s\n", __func__);
q6asm_audio_client_free(prtd->audio_client);
kfree(prtd);
runtime->private_data = NULL;
return 0;
}

View file

@ -446,6 +446,8 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
SNDRV_PCM_STREAM_PLAYBACK);
q6asm_audio_client_free(prtd->audio_client);
kfree(prtd);
runtime->private_data = NULL;
return 0;
}
@ -538,6 +540,7 @@ static int msm_pcm_capture_close(struct snd_pcm_substream *substream)
SNDRV_PCM_STREAM_CAPTURE);
q6asm_audio_client_free(prtd->audio_client);
kfree(prtd);
runtime->private_data = NULL;
return 0;
}