All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH 2/2] ASoC: simple-card: test memory allocation
Date: Fri,  8 Mar 2019 20:02:52 -0600	[thread overview]
Message-ID: <20190309020252.27860-2-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20190309020252.27860-1-pierre-louis.bossart@linux.intel.com>

devm_kcalloc() return value needs to be tested

Fixes: 17029e494edc6 ('ASoC: simple-card: add link_info')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/generic/simple-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 08df261024cf..bed4fe5721a2 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -715,7 +715,7 @@ static int simple_probe(struct platform_device *pdev)
 	dai_link  = devm_kcalloc(dev, li.link, sizeof(*dai_link),  GFP_KERNEL);
 	dais      = devm_kcalloc(dev, li.dais, sizeof(*dais),      GFP_KERNEL);
 	cconf     = devm_kcalloc(dev, li.conf, sizeof(*cconf),     GFP_KERNEL);
-	if (!dai_props || !dai_link || !dais)
+	if (!dai_props || !dai_link || !dais || !cconf)
 		return -ENOMEM;
 
 	/*
-- 
2.17.1

  reply	other threads:[~2019-03-09  2:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09  2:02 [PATCH 1/2] ASoC: audio-graph-card: test memory allocation Pierre-Louis Bossart
2019-03-09  2:02 ` Pierre-Louis Bossart [this message]
2019-03-11  0:20   ` [PATCH 2/2] ASoC: simple-card: " Kuninori Morimoto
2019-03-11 14:07     ` Pierre-Louis Bossart
2019-03-12  2:01       ` Kuninori Morimoto
2019-03-12 21:08         ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190309020252.27860-2-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.