From: Steven Finney Date: Thu, 13 Apr 2006 10:49:31 +0000 (+0200) Subject: [ALSA] Handle the error correctly in SNDCTL_DSP_SETFMT ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5c59e09d7e51f5781439aa6f1963076568fd1f4f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [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 --- 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) {