mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
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/20250610064322.26787-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -703,6 +703,9 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct
|
||||
unsigned char nval, oval;
|
||||
int change;
|
||||
|
||||
if (chip->mode & (SB_MODE_PLAYBACK | SB_MODE_CAPTURE))
|
||||
return -EBUSY;
|
||||
|
||||
nval = ucontrol->value.enumerated.item[0];
|
||||
if (nval > 2)
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user