summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-10-01 19:44:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-24 08:20:08 +0100
commitd7e546d06182165ceb5c5c1d8ef54f2c02ee75cd (patch)
tree7e8a766074835b4c9c0a24fde896992d74e2f70c /sound
parent27ab8f1648ac53dbddd97486c0beb6d6a2d44aa9 (diff)
downloadlinux-stable-d7e546d06182165ceb5c5c1d8ef54f2c02ee75cd.tar.gz
linux-stable-d7e546d06182165ceb5c5c1d8ef54f2c02ee75cd.tar.bz2
linux-stable-d7e546d06182165ceb5c5c1d8ef54f2c02ee75cd.zip
ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()
[ Upstream commit 8e9f7265eda9f3a662ca1ca47a69042a7840735b ] The q6asm_audio_client_alloc() doesn't return NULL, it returns error pointers. Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/qcom/qdsp6/q6asm-dai.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index 9db9a2944ef2..c1a7d376a3fe 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -319,10 +319,11 @@ static int q6asm_dai_open(struct snd_pcm_substream *substream)
prtd->audio_client = q6asm_audio_client_alloc(dev,
(q6asm_cb)event_handler, prtd, stream_id,
LEGACY_PCM_MODE);
- if (!prtd->audio_client) {
+ if (IS_ERR(prtd->audio_client)) {
pr_info("%s: Could not allocate memory\n", __func__);
+ ret = PTR_ERR(prtd->audio_client);
kfree(prtd);
- return -ENOMEM;
+ return ret;
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)