Commit d7e546d0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()

[ Upstream commit 8e9f7265 ]

The q6asm_audio_client_alloc() doesn't return NULL, it returns error
pointers.

Fixes: 2a9e92d3 ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 27ab8f16
...@@ -319,10 +319,11 @@ static int q6asm_dai_open(struct snd_pcm_substream *substream) ...@@ -319,10 +319,11 @@ static int q6asm_dai_open(struct snd_pcm_substream *substream)
prtd->audio_client = q6asm_audio_client_alloc(dev, prtd->audio_client = q6asm_audio_client_alloc(dev,
(q6asm_cb)event_handler, prtd, stream_id, (q6asm_cb)event_handler, prtd, stream_id,
LEGACY_PCM_MODE); LEGACY_PCM_MODE);
if (!prtd->audio_client) { if (IS_ERR(prtd->audio_client)) {
pr_info("%s: Could not allocate memory\n", __func__); pr_info("%s: Could not allocate memory\n", __func__);
ret = PTR_ERR(prtd->audio_client);
kfree(prtd); kfree(prtd);
return -ENOMEM; return ret;
} }
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment