diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2025-05-30 16:10:22 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-06-02 12:26:49 +0100 |
commit | 5f342aeee2724d31046172eb5caab8e0e8afd57d (patch) | |
tree | b401aa8e422a2255059eafbfb23c322e8ed578d0 | |
parent | 9e3285be55e6c0829e451b4a341e3059da47ec9d (diff) |
ASoC: Intel: avs: Verify kcalloc() status when setting constraints
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>
Link: https://patch.msgid.link/20250530141025.2942936-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/avs/path.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c index ed8f0ea0e10db..e8e6b1c7fc903 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) { |