diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-12-21 10:05:16 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-03 17:32:55 +0100 |
commit | 3391034e18b35bba8904cae457598ac276ac685a (patch) | |
tree | fa87329bbe91a504ca0028dc27c2d33a77e9a9b7 /sound/soc | |
parent | ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data() (diff) | |
download | linux-3391034e18b35bba8904cae457598ac276ac685a.tar.xz linux-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/soc')
-rw-r--r-- | sound/soc/qcom/qdsp6/q6asm-dai.c | 5 |
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 * |