csubstream->open_flag = 1; 
csubstream->ffile = file; 
static int snd_pcm_oss_open_file(struct file *file,				 snd_pcm_t *pcm,				 snd_pcm_oss_file_t **rpcm_oss_file,				 int minor,				 snd_pcm_oss_setup_t *psetup,				 snd_pcm_oss_setup_t *csetup){	int err = 0;	snd_pcm_oss_file_t *pcm_oss_file;	snd_pcm_substream_t *psubstream = NULL, *csubstream = NULL;	unsigned int f_mode = file->f_mode;	snd_assert(rpcm_oss_file != NULL, return -EINVAL);	*rpcm_oss_file = NULL;	pcm_oss_file = kcalloc(1, sizeof(*pcm_oss_file), GFP_KERNEL);	if (pcm_oss_file == NULL)		return -ENOMEM;	if ((f_mode & (FMODE_WRITE|FMODE_READ)) == (FMODE_WRITE|FMODE_READ) &&	    (pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX))		f_mode = FMODE_WRITE;	if ((f_mode & FMODE_WRITE) && !(psetup && psetup->disable)) {		if ((err = snd_pcm_open_substream(pcm, SNDRV_PCM_STREAM_PLAYBACK,					       &psubstream)) < 0) {			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK] = psubstream;	}	if ((f_mode & FMODE_READ) && !(csetup && csetup->disable)) {		if ((err = snd_pcm_open_substream(pcm, SNDRV_PCM_STREAM_CAPTURE, 					       &csubstream)) < 0) {			if (!(f_mode & FMODE_WRITE) || err != -ENODEV) {				snd_pcm_oss_release_file(pcm_oss_file);				return err;			} else {				csubstream = NULL;			}		}		pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE] = csubstream;	}		if (psubstream == NULL && csubstream == NULL) {		snd_pcm_oss_release_file(pcm_oss_file);		return -EINVAL;	}	if (psubstream != NULL) {		psubstream->oss.file = pcm_oss_file;		err = snd_pcm_hw_constraints_init(psubstream);		if (err < 0) {			snd_printd("snd_pcm_hw_constraint_init failed\n");			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		if ((err = psubstream->ops->open(psubstream)) < 0) {			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		psubstream->open_flag = 1;		err = snd_pcm_hw_constraints_complete(psubstream);		if (err < 0) {			snd_printd("snd_pcm_hw_constraint_complete failed\n");			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		psubstream->ffile = file;		snd_pcm_oss_init_substream(psubstream, psetup, minor);	}	if (csubstream != NULL) {		csubstream->oss.file = pcm_oss_file;		err = snd_pcm_hw_constraints_init(csubstream);		if (err < 0) {			snd_printd("snd_pcm_hw_constraint_init failed\n");			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		if ((err = csubstream->ops->open(csubstream)) < 0) {			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		csubstream->open_flag = 1;		err = snd_pcm_hw_constraints_complete(csubstream);		if (err < 0) {			snd_printd("snd_pcm_hw_constraint_complete failed\n");			snd_pcm_oss_release_file(pcm_oss_file);			return err;		}		csubstream->ffile = file;		snd_pcm_oss_init_substream(csubstream, csetup, minor);	}	file->private_data = pcm_oss_file;	*rpcm_oss_file = pcm_oss_file;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/443feb882679e21ba5d1e0ff9eff067ac26d9461/pcm_oss.c/buggy/sound/core/oss/pcm_oss.c