public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()
@ 2018-10-01 16:44 Dan Carpenter
  2018-10-04 10:42 ` Applied "ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()" to the asoc tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-10-01 16:44 UTC (permalink / raw)
  To: Patrick Lai
  Cc: alsa-devel, Banajit Goswami, kernel-janitors, Takashi Iwai,
	Liam Girdwood, Vinod Koul, Mark Brown, Srinivas Kandagatla

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 <dan.carpenter@oracle.com>

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-04 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-01 16:44 [PATCH] ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR() Dan Carpenter
2018-10-04 10:42 ` Applied "ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox