Skip to content

Commit ed29e07

Browse files
committed
ALSA: sb: Don't allow changing the DMA mode during operations
When a PCM stream is already running, one shouldn't change the DMA mode via kcontrol, which may screw up the hardware. Return -EBUSY instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218185 Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 7b23887 commit ed29e07

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/isa/sb/sb16_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct
703703
unsigned char nval, oval;
704704
int change;
705705

706+
if (chip->mode & (SB_MODE_PLAYBACK | SB_MODE_CAPTURE))
707+
return -EBUSY;
708+
706709
nval = ucontrol->value.enumerated.item[0];
707710
if (nval > 2)
708711
return -EINVAL;

0 commit comments

Comments
 (0)