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/core/oss/pcm_oss.c') 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) { -- cgit v1.2.3 From b7d90a356a43f4609bd6290fc2e1ca4ef79d4458 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 25 Apr 2006 12:56:04 +0200 Subject: [ALSA] Fix Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n Fixed Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n. Add ifdef to struct fields for optimization and better compile checks. Signed-off-by: Takashi Iwai --- sound/core/oss/pcm_oss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/core/oss/pcm_oss.c') diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index a7567b89179..ac990bf0b48 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -2214,7 +2214,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area) return 0; } -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_SND_VERBOSE_PROCFS /* * /proc interface */ @@ -2368,10 +2368,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm) } } } -#else /* !CONFIG_PROC_FS */ +#else /* !CONFIG_SND_VERBOSE_PROCFS */ #define snd_pcm_oss_proc_init(pcm) #define snd_pcm_oss_proc_done(pcm) -#endif /* CONFIG_PROC_FS */ +#endif /* CONFIG_SND_VERBOSE_PROCFS */ /* * ENTRY functions -- cgit v1.2.3