summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorSteven Finney <sfinney@healthhero.com>2006-04-13 12:49:31 +0200
committerJaroslav Kysela <perex@suse.cz>2006-04-27 21:10:06 +0200
commit5c59e09d7e51f5781439aa6f1963076568fd1f4f (patch)
tree814d6aac2cfd5fa1b38721ae0ac1ac515a819e7a /sound/core
parentbc56eff1279d2f33a6afe74a673360ae1cd0d838 (diff)
[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 <sfinney@healthhero.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/pcm_oss.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index c5978d6c608..a7567b89179 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) {