diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-06-14 16:06:54 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-06-14 16:06:54 -0700 |
| commit | f9a1c8211f0acdce964d02cc7dce79cfec5014bc (patch) | |
| tree | e7cd434d4397f8c0732cc912bf78368ff3a9a7bc | |
| parent | a0e118cf53a34264a4db5d1aa04c7547f81d2d45 (diff) | |
| parent | b9e306af638e11aa3b176064c327fa88e94f9f1e (diff) | |
Merge "ASoC: qdsp6v2: Fix null pointer dereference for prtd pointer"
| -rw-r--r-- | sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c index 9ab17d87b268..c05f487d00fa 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c @@ -660,6 +660,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream) if (!prtd->audio_client) { pr_info("%s: Could not allocate memory\n", __func__); kfree(prtd); + prtd = NULL; return -ENOMEM; } @@ -1135,6 +1136,12 @@ static int msm_pcm_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol, } prtd = substream->runtime->private_data; + if (prtd == NULL) { + pr_err("%s prtd is null.\n", __func__); + ret = -EINVAL; + goto done; + } + if (prtd->audio_client == NULL) { pr_err("%s prtd is null.\n", __func__); ret = -EINVAL; |
