Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c59e09d authored by Steven Finney's avatar Steven Finney Committed by Jaroslav Kysela
Browse files

[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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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) {