OSDN Git Service

ALSA: compress: Prevent bypasses of set_params
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 22 Jul 2019 09:24:34 +0000 (10:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 23 Jul 2019 10:07:36 +0000 (12:07 +0200)
commit26c3f1542f5064310ad26794c09321780d00c57d
tree6e355a09d749bcd68579a78c01569b8cd181dafa
parent4475f8c4ab7b248991a60d9c02808dbb813d6be8
ALSA: compress: Prevent bypasses of set_params

Currently, whilst in SNDRV_PCM_STATE_OPEN it is possible to call
snd_compr_stop, snd_compr_drain and snd_compr_partial_drain, which
allow a transition to SNDRV_PCM_STATE_SETUP. The stream should
only be able to move to the setup state once it has received a
SNDRV_COMPRESS_SET_PARAMS ioctl. Fix this issue by not allowing
those ioctls whilst in the open state.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c