Skip to content

Commit

Permalink
ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()
Browse files Browse the repository at this point in the history
The q6asm_audio_client_alloc() doesn't return NULL, it returns error
pointers.

Fixes: 2a9e92d ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Dan Carpenter authored and broonie committed Oct 4, 2018
1 parent 9c80c5a commit 8e9f726
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/soc/qcom/qdsp6/q6asm-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e9f726

Please sign in to comment.