Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org
Cc: tiwai@suse.com, perex@perex.cz,
	amadeuszx.slawinski@linux.intel.com, linux-sound@vger.kernel.org,
	Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 6/9] ASoC: Intel: avs: Verify kcalloc() status when setting constraints
Date: Fri, 30 May 2025 16:10:22 +0200	[thread overview]
Message-ID: <20250530141025.2942936-7-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20250530141025.2942936-1-cezary.rojewski@intel.com>

All memory operations shall be checked.

Fixes: f2f847461fb7 ("ASoC: Intel: avs: Constrain path based on BE capabilities")
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/avs/path.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c
index ed8f0ea0e10d..e8e6b1c7fc90 100644
--- a/sound/soc/intel/avs/path.c
+++ b/sound/soc/intel/avs/path.c
@@ -134,6 +134,8 @@ int avs_path_set_constraint(struct avs_dev *adev, struct avs_tplg_path_template
 	rlist = kcalloc(i, sizeof(*rlist), GFP_KERNEL);
 	clist = kcalloc(i, sizeof(*clist), GFP_KERNEL);
 	slist = kcalloc(i, sizeof(*slist), GFP_KERNEL);
+	if (!rlist || !clist || !slist)
+		return -ENOMEM;
 
 	i = 0;
 	list_for_each_entry(path_template, &template->path_list, node) {
-- 
2.25.1


  parent reply	other threads:[~2025-05-30 13:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30 14:10 [PATCH 0/9] ASoC: Intel: avs: Set of functional fixes Cezary Rojewski
2025-05-30 14:10 ` [PATCH 1/9] ASoC: codecs: hda: Fix RPM usage count underflow Cezary Rojewski
2025-05-30 14:10 ` [PATCH 2/9] ASoC: Intel: avs: Fix deadlock when the failing IPC is SET_D0IX Cezary Rojewski
2025-05-30 14:10 ` [PATCH 3/9] ASoC: Intel: avs: Fix PPLCxFMT calculation Cezary Rojewski
2025-05-30 14:10 ` [PATCH 4/9] ASoC: Intel: avs: Fix possible null-ptr-deref when initing hw Cezary Rojewski
2025-05-30 14:10 ` [PATCH 5/9] ASoC: Intel: avs: Fix paths in MODULE_FIRMWARE hints Cezary Rojewski
2025-05-30 14:10 ` Cezary Rojewski [this message]
2025-05-30 14:10 ` [PATCH 7/9] ASoC: Intel: avs: Verify content returned by parse_int_array() Cezary Rojewski
2025-05-30 14:10 ` [PATCH 8/9] ASoC: Intel: avs: Simplify verification of parse_int_array() result Cezary Rojewski
2025-05-30 14:10 ` [PATCH 9/9] ASoC: Intel: avs: Include missing string.h Cezary Rojewski
2025-06-02 16:42 ` (subset) [PATCH 0/9] ASoC: Intel: avs: Set of functional fixes Mark Brown
2025-06-03 10:57   ` Cezary Rojewski
2025-06-03 11:01     ` Mark Brown
2025-06-03 11:03       ` Cezary Rojewski
2025-06-03 16:04 ` Mark Brown

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=20250530141025.2942936-7-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox