From: Takashi Iwai Date: Fri, 4 Aug 2006 18:37:33 +0000 (+0200) Subject: ALSA: Don't reject O_RDWR at opening PCM OSS X-Git-Tag: v2.6.17.8~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2f4638207875fb0a164cd39f16174ef794a1906;p=thirdparty%2Fkernel%2Fstable.git ALSA: Don't reject O_RDWR at opening PCM OSS Accept O_RDWR at opening a PCM OSS device that is read- or write-only, just for the compatibility with the behavior of older versions. Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index ac990bf0b48f7..785a2acd9adf3 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1745,6 +1745,8 @@ static int snd_pcm_oss_open_file(struct file *file, for (idx = 0; idx < 2; idx++) { if (setup[idx].disable) continue; + if (! pcm->streams[idx].substream_count) + continue; /* no matching substream */ if (idx == SNDRV_PCM_STREAM_PLAYBACK) { if (! (f_mode & FMODE_WRITE)) continue;