* [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards()
@ 2026-04-07 8:54 Cezary Rojewski
2026-04-07 8:54 ` [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params() Cezary Rojewski
2026-04-07 12:00 ` (subset) [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Cezary Rojewski @ 2026-04-07 8:54 UTC (permalink / raw)
To: broonie; +Cc: tiwai, perex, amade, linux-sound, Cezary Rojewski
Caller is responsible for freeing array allocated with
parse_int_array().
Found out by Coverity.
Fixes: 7d859189de13 ("ASoC: Intel: avs: Allow to specify custom configurations with i2s_test")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
sound/soc/intel/avs/board_selection.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c
index 8a46285181fa..dd0e7cd5a7dd 100644
--- a/sound/soc/intel/avs/board_selection.c
+++ b/sound/soc/intel/avs/board_selection.c
@@ -520,7 +520,8 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev)
if (num_elems > max_ssps) {
dev_err(adev->dev, "board supports only %d SSP, %d specified\n",
max_ssps, num_elems);
- return -EINVAL;
+ ret = -EINVAL;
+ goto exit;
}
for (ssp_port = 0; ssp_port < num_elems; ssp_port++) {
@@ -528,11 +529,13 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev)
for_each_set_bit(tdm_slot, &tdm_slots, 16) {
ret = avs_register_i2s_test_board(adev, ssp_port, tdm_slot);
if (ret)
- return ret;
+ goto exit;
}
}
- return 0;
+exit:
+ kfree(array);
+ return ret;
}
static int avs_register_i2s_board(struct avs_dev *adev, struct snd_soc_acpi_mach *mach)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params()
2026-04-07 8:54 [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Cezary Rojewski
@ 2026-04-07 8:54 ` Cezary Rojewski
2026-04-07 11:28 ` Mark Brown
2026-04-07 12:00 ` (subset) [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Cezary Rojewski @ 2026-04-07 8:54 UTC (permalink / raw)
To: broonie; +Cc: tiwai, perex, amade, linux-sound, Cezary Rojewski
Expected argument type is snd_pcm_format_t.
Found out by sparse.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
This is a continuation of topic "ASoC: Intel: avs: Set of streaming
fixes" from last year [1]. The warning keeps popping out in the scans,
time to get rid of it.
[1]: https://lore.kernel.org/linux-sound/dd089b21-571c-41e2-bcea-d666ee7af882@intel.com/
sound/soc/intel/avs/probes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index 74096236984a..099119ad28b3 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -144,7 +144,7 @@ static int avs_probe_compr_set_params(struct snd_compr_stream *cstream,
ret = snd_compr_malloc_pages(cstream, rtd->buffer_size);
if (ret < 0)
return ret;
- bps = snd_pcm_format_physical_width(params->codec.format);
+ bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format);
if (bps < 0)
return bps;
format_val = snd_hdac_stream_format(params->codec.ch_out, bps, params->codec.sample_rate);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params()
2026-04-07 8:54 ` [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params() Cezary Rojewski
@ 2026-04-07 11:28 ` Mark Brown
2026-04-07 13:16 ` Cezary Rojewski
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2026-04-07 11:28 UTC (permalink / raw)
To: Cezary Rojewski; +Cc: tiwai, perex, amade, linux-sound
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
On Tue, Apr 07, 2026 at 10:54:59AM +0200, Cezary Rojewski wrote:
> Expected argument type is snd_pcm_format_t.
> Found out by sparse.
> - bps = snd_pcm_format_physical_width(params->codec.format);
> + bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format);
There was an earlier patch for this one that didn't get reviewed (and
every time I looked at it the __force looks super suspect):
https://patch.msgid.link/20260325021752.238203-1-songxiebing@kylinos.cn
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards()
2026-04-07 8:54 [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Cezary Rojewski
2026-04-07 8:54 ` [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params() Cezary Rojewski
@ 2026-04-07 12:00 ` Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-04-07 12:00 UTC (permalink / raw)
To: Cezary Rojewski; +Cc: tiwai, perex, amade, linux-sound
On Tue, 07 Apr 2026 10:54:58 +0200, Cezary Rojewski wrote:
> ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.0
Thanks!
[1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards()
https://git.kernel.org/broonie/sound/c/c5408d818316
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params()
2026-04-07 11:28 ` Mark Brown
@ 2026-04-07 13:16 ` Cezary Rojewski
2026-04-07 14:36 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Cezary Rojewski @ 2026-04-07 13:16 UTC (permalink / raw)
To: Mark Brown; +Cc: tiwai, perex, amade, linux-sound
On 2026-04-07 1:28 PM, Mark Brown wrote:
> On Tue, Apr 07, 2026 at 10:54:59AM +0200, Cezary Rojewski wrote:
>> Expected argument type is snd_pcm_format_t.
>> Found out by sparse.
>
>> - bps = snd_pcm_format_physical_width(params->codec.format);
>> + bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format);
>
> There was an earlier patch for this one that didn't get reviewed (and
> every time I looked at it the __force looks super suspect):
>
> https://patch.msgid.link/20260325021752.238203-1-songxiebing@kylinos.cn
I don't mind either version. This is basically an incremental update
which I should have sent long ago. The warning keeps bothering us in
the scans.
Are you suggesting we should squelch the warning instead of forcing the
conversion here? The use of __force is present within
include/sound/pcm_params.h, params_format().
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params()
2026-04-07 13:16 ` Cezary Rojewski
@ 2026-04-07 14:36 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-04-07 14:36 UTC (permalink / raw)
To: Cezary Rojewski; +Cc: tiwai, perex, amade, linux-sound
[-- Attachment #1: Type: text/plain, Size: 484 bytes --]
On Tue, Apr 07, 2026 at 03:16:18PM +0200, Cezary Rojewski wrote:
> On 2026-04-07 1:28 PM, Mark Brown wrote:
> I don't mind either version. This is basically an incremental update which
> I should have sent long ago. The warning keeps bothering us in the scans.
> Are you suggesting we should squelch the warning instead of forcing the
> conversion here? The use of __force is present within
> include/sound/pcm_params.h, params_format().
No, it's fine - it's ugly but whatever.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-04-07 16:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 8:54 [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Cezary Rojewski
2026-04-07 8:54 ` [PATCH 2/2] ASoC: Intel: avs: Fix type warning in avs_probe_compr_set_params() Cezary Rojewski
2026-04-07 11:28 ` Mark Brown
2026-04-07 13:16 ` Cezary Rojewski
2026-04-07 14:36 ` Mark Brown
2026-04-07 12:00 ` (subset) [PATCH 1/2] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox