* [PATCH 0/3] SDCA Bug Fixes
@ 2025-07-15 15:17 Charles Keepax
2025-07-15 15:17 ` [PATCH 1/3] ASoC: SDCA: Fix off by one error in IRQ bound check Charles Keepax
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Charles Keepax @ 2025-07-15 15:17 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
dan.carpenter, shumingf, linux-sound, patches
Some small SDCA bug fixes reported from various sources. An array bounds
check, an uninitialised variable and some memory allocations that should
zero initialise.
Charles Keepax (3):
ASoC: SDCA: Fix off by one error in IRQ bound check
ASoC: SDCA: Avoid use of uninitialised local name variable
ASoC: SDCA: Update memory allocations to zero initialise
sound/soc/sdca/sdca_asoc.c | 12 ++++++------
sound/soc/sdca/sdca_interrupts.c | 5 ++---
2 files changed, 8 insertions(+), 9 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ASoC: SDCA: Fix off by one error in IRQ bound check
2025-07-15 15:17 [PATCH 0/3] SDCA Bug Fixes Charles Keepax
@ 2025-07-15 15:17 ` Charles Keepax
2025-07-15 15:17 ` [PATCH 2/3] ASoC: SDCA: Avoid use of uninitialised local name variable Charles Keepax
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2025-07-15 15:17 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
dan.carpenter, shumingf, linux-sound, patches
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202507150415.M1tCgi3p-lkp@intel.com/
Fixes: b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/sdca/sdca_interrupts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index 2f85fcc6e5446..eb9e7eff4b4ba 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -262,7 +262,7 @@ int sdca_irq_request(struct device *dev, struct sdca_interrupt_info *info,
{
int ret;
- if (sdca_irq < 0 || sdca_irq > SDCA_MAX_INTERRUPTS) {
+ if (sdca_irq < 0 || sdca_irq >= SDCA_MAX_INTERRUPTS) {
dev_err(dev, "bad irq request: %d\n", sdca_irq);
return -EINVAL;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] ASoC: SDCA: Avoid use of uninitialised local name variable
2025-07-15 15:17 [PATCH 0/3] SDCA Bug Fixes Charles Keepax
2025-07-15 15:17 ` [PATCH 1/3] ASoC: SDCA: Fix off by one error in IRQ bound check Charles Keepax
@ 2025-07-15 15:17 ` Charles Keepax
2025-07-15 15:17 ` [PATCH 3/3] ASoC: SDCA: Update memory allocations to zero initialise Charles Keepax
2025-07-16 10:14 ` [PATCH 0/3] SDCA Bug Fixes Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2025-07-15 15:17 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
dan.carpenter, shumingf, linux-sound, patches
The local name variable is accidentally left over from an earlier
version of the code. Remove the variable and its uninitialised usage.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202507150415.M1tCgi3p-lkp@intel.com/
Fixes: b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/sdca/sdca_interrupts.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index eb9e7eff4b4ba..b76512732af87 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -342,7 +342,6 @@ int sdca_irq_populate(struct sdca_function_data *function,
int irq = control->interrupt_position;
struct sdca_interrupt *interrupt;
irq_handler_t handler;
- const char *name;
int ret;
if (irq == SDCA_NO_INTERRUPT) {
@@ -385,7 +384,7 @@ int sdca_irq_populate(struct sdca_function_data *function,
handler, interrupt);
if (ret) {
dev_err(dev, "failed to request irq %s: %d\n",
- name, ret);
+ interrupt->name, ret);
return ret;
}
}
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] ASoC: SDCA: Update memory allocations to zero initialise
2025-07-15 15:17 [PATCH 0/3] SDCA Bug Fixes Charles Keepax
2025-07-15 15:17 ` [PATCH 1/3] ASoC: SDCA: Fix off by one error in IRQ bound check Charles Keepax
2025-07-15 15:17 ` [PATCH 2/3] ASoC: SDCA: Avoid use of uninitialised local name variable Charles Keepax
@ 2025-07-15 15:17 ` Charles Keepax
2025-07-16 10:14 ` [PATCH 0/3] SDCA Bug Fixes Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2025-07-15 15:17 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
dan.carpenter, shumingf, linux-sound, patches
All the memory allocations in the SDCA ASoC helpers rely on fields being
zero initialised, the code should use kzalloc not kmalloc.
Reported-by: Shuming Fan <shumingf@realtek.com>
Fixes: 2c8b3a8e6aa8 ("ASoC: SDCA: Create DAPM widgets and routes from DisCo")
Fixes: c3ca24e3fcb6 ("ASoC: SDCA: Create ALSA controls from DisCo")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/sdca/sdca_asoc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
index dd7b19083c85f..ebb1c87facf9c 100644
--- a/sound/soc/sdca/sdca_asoc.c
+++ b/sound/soc/sdca/sdca_asoc.c
@@ -230,11 +230,11 @@ static int entity_early_parse_ge(struct device *dev,
if (!control_name)
return -ENOMEM;
- kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
+ kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
if (!kctl)
return -ENOMEM;
- soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
+ soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
if (!soc_enum)
return -ENOMEM;
@@ -561,11 +561,11 @@ static int entity_parse_su_class(struct device *dev,
const char **texts;
int i;
- kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
+ kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
if (!kctl)
return -ENOMEM;
- soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
+ soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
if (!soc_enum)
return -ENOMEM;
@@ -672,7 +672,7 @@ static int entity_parse_mu(struct device *dev,
if (!control_name)
return -ENOMEM;
- mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
+ mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
if (!mc)
return -ENOMEM;
@@ -926,7 +926,7 @@ static int populate_control(struct device *dev,
if (!control_name)
return -ENOMEM;
- mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
+ mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
if (!mc)
return -ENOMEM;
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] SDCA Bug Fixes
2025-07-15 15:17 [PATCH 0/3] SDCA Bug Fixes Charles Keepax
` (2 preceding siblings ...)
2025-07-15 15:17 ` [PATCH 3/3] ASoC: SDCA: Update memory allocations to zero initialise Charles Keepax
@ 2025-07-16 10:14 ` Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2025-07-16 10:14 UTC (permalink / raw)
To: Charles Keepax
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
dan.carpenter, shumingf, linux-sound, patches
On Tue, 15 Jul 2025 16:17:20 +0100, Charles Keepax wrote:
> Some small SDCA bug fixes reported from various sources. An array bounds
> check, an uninitialised variable and some memory allocations that should
> zero initialise.
>
> Charles Keepax (3):
> ASoC: SDCA: Fix off by one error in IRQ bound check
> ASoC: SDCA: Avoid use of uninitialised local name variable
> ASoC: SDCA: Update memory allocations to zero initialise
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: SDCA: Fix off by one error in IRQ bound check
commit: 3f2e4c11925ee24a34853b0d608ab85df2430555
[2/3] ASoC: SDCA: Avoid use of uninitialised local name variable
commit: 71562278a189af2ca202eafa0ab71a9b68469207
[3/3] ASoC: SDCA: Update memory allocations to zero initialise
commit: 15247b5a63f506125360fa45d7aa1fbe8b903b95
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] 5+ messages in thread
end of thread, other threads:[~2025-07-16 10:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 15:17 [PATCH 0/3] SDCA Bug Fixes Charles Keepax
2025-07-15 15:17 ` [PATCH 1/3] ASoC: SDCA: Fix off by one error in IRQ bound check Charles Keepax
2025-07-15 15:17 ` [PATCH 2/3] ASoC: SDCA: Avoid use of uninitialised local name variable Charles Keepax
2025-07-15 15:17 ` [PATCH 3/3] ASoC: SDCA: Update memory allocations to zero initialise Charles Keepax
2025-07-16 10:14 ` [PATCH 0/3] SDCA Bug Fixes Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).