unsigned long flags, flags2; 
unsigned long flags; 
static int vino_capture_next(struct vino_channel_settings *vcs, int start){	struct vino_framebuffer *fb;	unsigned int incoming, id;	int err = 0;	unsigned long flags, flags2;	dprintk("vino_capture_next():\n");	spin_lock_irqsave(&vcs->capture_lock, flags);	if (start) {		/* start capture only if capture isn't in progress already */		if (vcs->capturing) {			spin_unlock_irqrestore(&vcs->capture_lock, flags);			return 0;		}	} else {		/* capture next frame:		 * stop capture if capturing is not set */		if (!vcs->capturing) {			spin_unlock_irqrestore(&vcs->capture_lock, flags);			return 0;		}	}	err = vino_queue_get_incoming(&vcs->fb_queue, &incoming);	if (err) {		dprintk("vino_capture_next(): vino_queue_get_incoming() "			"failed\n");		err = -EINVAL;		goto out;	}	if (incoming == 0) {		dprintk("vino_capture_next(): no buffers available\n");		goto out;	}	fb = vino_queue_peek(&vcs->fb_queue, &id);	if (fb == NULL) {		dprintk("vino_capture_next(): vino_queue_peek() failed\n");		err = -EINVAL;		goto out;	}	spin_lock_irqsave(&fb->state_lock, flags2);	fb->state = VINO_FRAMEBUFFER_UNUSED;	spin_unlock_irqrestore(&fb->state_lock, flags2);	if (start) {		vcs->capturing = 1;	}	spin_unlock_irqrestore(&vcs->capture_lock, flags);	err = vino_capture(vcs, fb);	return err;out:	vcs->capturing = 0;	spin_unlock_irqrestore(&vcs->capture_lock, flags);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a637a114f36b94a1ad8b9867f43bac0414958420/vino.c/buggy/drivers/media/video/vino.c