diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-06-10 08:43:19 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-07-10 16:03:15 +0200 |
| commit | c7922052c6f26e69e6361a1604b6828ddaac4be3 (patch) | |
| tree | c03b7f10ee2dd9d5c88bdf008af3525d8ab4ac26 | |
| parent | c40ad1c04d306f7fde26337fdcf8a5979657d93f (diff) | |
| download | linux-c7922052c6f26e69e6361a1604b6828ddaac4be3.tar.gz linux-c7922052c6f26e69e6361a1604b6828ddaac4be3.tar.bz2 linux-c7922052c6f26e69e6361a1604b6828ddaac4be3.zip | |
ALSA: sb: Don't allow changing the DMA mode during operations
[ Upstream commit ed29e073ba93f2d52832804cabdd831d5d357d33 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | sound/isa/sb/sb16_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index a9b87e159b2d..5efbd0a41312 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -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; |
