From: Dan Carpenter Date: Mon, 1 Oct 2018 16:44:30 +0000 (+0300) Subject: ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR() X-Git-Tag: v4.20-rc1~20^2~3^2~55 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8e9f7265eda9f3a662ca1ca47a69042a7840735b;p=uclinux-h8%2Flinux.git ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR() 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index c3806d7037fc..a16c71c03058 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -318,10 +318,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)