aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-12-21 12:05:16 +0300
committerMark Brown <broonie@kernel.org>2019-01-03 16:32:55 +0000
commit3391034e18b35bba8904cae457598ac276ac685a (patch)
treefa87329bbe91a504ca0028dc27c2d33a77e9a9b7 /sound
parentASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data() (diff)
downloadlinux-dev-3391034e18b35bba8904cae457598ac276ac685a.tar.xz
linux-dev-3391034e18b35bba8904cae457598ac276ac685a.zip
ASoC: qdsp6: q6asm-dai: Fix a NULL vs IS_ERR() bug
The q6asm_audio_client_alloc() doesn't return NULL, it returns error pointers. Fixes: 22930c79ac5c ("ASoC: qdsp6: q6asm-dai: Add support to compress offload") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@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 9d738b4c1e05..3407e51b8861 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -570,10 +570,11 @@ static int q6asm_dai_compr_open(struct snd_compr_stream *stream)
prtd->audio_client = q6asm_audio_client_alloc(dev,
(q6asm_cb)compress_event_handler,
prtd, stream_id, LEGACY_PCM_MODE);
- if (!prtd->audio_client) {
+ if (IS_ERR(prtd->audio_client)) {
dev_err(dev, "Could not allocate memory\n");
+ ret = PTR_ERR(prtd->audio_client);
kfree(prtd);
- return -ENOMEM;
+ return ret;
}
size = COMPR_PLAYBACK_MAX_FRAGMENT_SIZE *