Commit 5c59e09d authored by Steven Finney's avatar Steven Finney Committed by 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: default avatarSteven Finney <sfinney@healthhero.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment