From 5c59e09d7e51f5781439aa6f1963076568fd1f4f Mon Sep 17 00:00:00 2001 From: Steven Finney Date: Thu, 13 Apr 2006 12:49:31 +0200 Subject: [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: Steven Finney Signed-off-by: Takashi Iwai --- sound/core/oss/pcm_oss.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index c5978d6c6080..a7567b891791 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -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) { -- cgit v1.2.3-59-g8ed1b