提交 5c59e09d 编写于 作者: S Steven Finney 提交者: Jaroslav Kysela

[ALSA] Handle the error correctly in SNDCTL_DSP_SETFMT ioctl

Handle the error returned from snd_pcm_oss_get_formats() correctly
in SNDCTL_DSP_SETFMT ioctl handler of PCM OSS emulation.
Signed-off-by: NSteven Finney <sfinney@healthhero.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 bc56eff1
......@@ -1242,6 +1242,8 @@ static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int for
if (format != AFMT_QUERY) {
formats = snd_pcm_oss_get_formats(pcm_oss_file);
if (formats < 0)
return formats;
if (!(formats & format))
format = AFMT_U8;
for (idx = 1; idx >= 0; --idx) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册