diff options
| author | Charles Keepax <[email protected]> | 2025-07-22 10:23:05 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2025-07-22 11:20:42 +0000 |
| commit | 59c5dbd585a0bee70e51fcdf36185f7602b9c285 (patch) | |
| tree | ea8ff7a6ab04f0c2181057c1b5c0a5225fbdf769 | |
| parent | ASoC: SDCA: Check devm_mutex_init() return value (diff) | |
| download | kernel-59c5dbd585a0bee70e51fcdf36185f7602b9c285.tar.gz kernel-59c5dbd585a0bee70e51fcdf36185f7602b9c285.zip | |
ASoC: SDCA: Shrink detected_mode_handler() stack frame
The stack frame for detected_mode_handler() is a bit large. Dynamically
allocate the control value struct, which is most of the size, to avoid
this.
Fixes: b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Charles Keepax <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
| -rw-r--r-- | sound/soc/sdca/sdca_interrupts.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index d442ba2f5681..8018773ee426 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -144,7 +144,7 @@ static irqreturn_t detected_mode_handler(int irq, void *data) struct snd_soc_card *card = component->card; struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem; struct snd_kcontrol *kctl = interrupt->priv; - struct snd_ctl_elem_value ucontrol; + struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL; struct soc_enum *soc_enum; unsigned int reg, val; int ret; @@ -204,10 +204,14 @@ static irqreturn_t detected_mode_handler(int irq, void *data) dev_dbg(dev, "%s: %#x\n", interrupt->name, val); - ucontrol.value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); + ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL); + if (!ucontrol) + return IRQ_NONE; + + ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); down_write(rwsem); - ret = kctl->put(kctl, &ucontrol); + ret = kctl->put(kctl, ucontrol); up_write(rwsem); if (ret < 0) { dev_err(dev, "failed to update selected mode: %d\n", ret); |
