if (fh->ov.clips) kfree(fh->ov.clips); 
kfree(fh->ov.clips); 
static int setup_window(struct bttv_fh *fh, struct bttv *btv,			struct v4l2_window *win, int fixup){	struct v4l2_clip *clips = NULL;	int n,size,retval = 0;	if (NULL == fh->ovfmt)		return -EINVAL;	if (!(fh->ovfmt->flags & FORMAT_FLAGS_PACKED))		return -EINVAL;	retval = verify_window(&bttv_tvnorms[btv->tvnorm],win,fixup);	if (0 != retval)		return retval;	/* copy clips  --  luckily v4l1 + v4l2 are binary	   compatible here ...*/	n = win->clipcount;	size = sizeof(*clips)*(n+4);	clips = kmalloc(size,GFP_KERNEL);	if (NULL == clips)		return -ENOMEM;	if (n > 0) {		if (copy_from_user(clips,win->clips,sizeof(struct v4l2_clip)*n)) {			kfree(clips);			return -EFAULT;		}	}	/* clip against screen */	if (NULL != btv->fbuf.base)		n = btcx_screen_clips(btv->fbuf.fmt.width, btv->fbuf.fmt.height,				      &win->w, clips, n);	btcx_sort_clips(clips,n);	/* 4-byte alignments */	switch (fh->ovfmt->depth) {	case 8:	case 24:		btcx_align(&win->w, clips, n, 3);		break;	case 16:		btcx_align(&win->w, clips, n, 1);		break;	case 32:		/* no alignment fixups needed */		break;	default:		BUG();	}	down(&fh->cap.lock);	if (fh->ov.clips)		kfree(fh->ov.clips);	fh->ov.clips    = clips;	fh->ov.nclips   = n;	fh->ov.w        = win->w;	fh->ov.field    = win->field;	fh->ov.setup_ok = 1;	btv->init.ov.w.width   = win->w.width;	btv->init.ov.w.height  = win->w.height;	btv->init.ov.field     = win->field;	/* update overlay if needed */	retval = 0;	if (check_btres(fh, RESOURCE_OVERLAY)) {		struct bttv_buffer *new;		new = videobuf_alloc(sizeof(*new));		bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);		retval = bttv_switch_overlay(btv,fh,new);	}	up(&fh->cap.lock);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2ea7533060e361810c21b2f5ee02151c4dfb85d8/bttv-driver.c/buggy/drivers/media/video/bttv-driver.c