Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250722102305.2513755-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
59c5dbd5 5b838a24

+7 -3
+7 -3
sound/soc/sdca/sdca_interrupts.c
··· 144 144 struct snd_soc_card *card = component->card; 145 145 struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem; 146 146 struct snd_kcontrol *kctl = interrupt->priv; 147 - struct snd_ctl_elem_value ucontrol; 147 + struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL; 148 148 struct soc_enum *soc_enum; 149 149 unsigned int reg, val; 150 150 int ret; ··· 204 204 205 205 dev_dbg(dev, "%s: %#x\n", interrupt->name, val); 206 206 207 - ucontrol.value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); 207 + ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL); 208 + if (!ucontrol) 209 + return IRQ_NONE; 210 + 211 + ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); 208 212 209 213 down_write(rwsem); 210 - ret = kctl->put(kctl, &ucontrol); 214 + ret = kctl->put(kctl, ucontrol); 211 215 up_write(rwsem); 212 216 if (ret < 0) { 213 217 dev_err(dev, "failed to update selected mode: %d\n", ret);