Skip to content

Commit 59c5dbd

Browse files
charleskeepaxbroonie
authored andcommitted
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: b9ab3b6 ("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]>
1 parent 5b838a2 commit 59c5dbd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sound/soc/sdca/sdca_interrupts.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static irqreturn_t detected_mode_handler(int irq, void *data)
144144
struct snd_soc_card *card = component->card;
145145
struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem;
146146
struct snd_kcontrol *kctl = interrupt->priv;
147-
struct snd_ctl_elem_value ucontrol;
147+
struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL;
148148
struct soc_enum *soc_enum;
149149
unsigned int reg, val;
150150
int ret;
@@ -204,10 +204,14 @@ static irqreturn_t detected_mode_handler(int irq, void *data)
204204

205205
dev_dbg(dev, "%s: %#x\n", interrupt->name, val);
206206

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);
208212

209213
down_write(rwsem);
210-
ret = kctl->put(kctl, &ucontrol);
214+
ret = kctl->put(kctl, ucontrol);
211215
up_write(rwsem);
212216
if (ret < 0) {
213217
dev_err(dev, "failed to update selected mode: %d\n", ret);

0 commit comments

Comments
 (0)