Commit dd74257b authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] video-buf oops/crash fixes

Some places which need adaption to the last video-buf API change where
forgotten, this patches fixes them up.  Hope I really caught them all now.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4c089f74
...@@ -2418,7 +2418,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, ...@@ -2418,7 +2418,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
if (0 != retval) if (0 != retval)
goto fh_unlock_and_return; goto fh_unlock_and_return;
spin_lock_irqsave(&btv->s_lock,flags); spin_lock_irqsave(&btv->s_lock,flags);
buffer_queue(file->private_data,&buf->vb); buffer_queue(&fh->cap,&buf->vb);
spin_unlock_irqrestore(&btv->s_lock,flags); spin_unlock_irqrestore(&btv->s_lock,flags);
up(&fh->cap.lock); up(&fh->cap.lock);
return 0; return 0;
...@@ -2881,11 +2881,11 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) ...@@ -2881,11 +2881,11 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
} }
fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR; fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR;
field = videobuf_next_field(&fh->cap); field = videobuf_next_field(&fh->cap);
if (0 != fh->cap.ops->buf_prepare(file->private_data,fh->cap.read_buf,field)) { if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) {
up(&fh->cap.lock); up(&fh->cap.lock);
return POLLERR; return POLLERR;
} }
fh->cap.ops->buf_queue(file->private_data,fh->cap.read_buf); fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
fh->cap.read_off = 0; fh->cap.read_off = 0;
} }
up(&fh->cap.lock); up(&fh->cap.lock);
...@@ -2975,7 +2975,7 @@ static int bttv_release(struct inode *inode, struct file *file) ...@@ -2975,7 +2975,7 @@ static int bttv_release(struct inode *inode, struct file *file)
free_btres(btv,fh,RESOURCE_VIDEO); free_btres(btv,fh,RESOURCE_VIDEO);
} }
if (fh->cap.read_buf) { if (fh->cap.read_buf) {
buffer_release(file->private_data,fh->cap.read_buf); buffer_release(&fh->cap,fh->cap.read_buf);
kfree(fh->cap.read_buf); kfree(fh->cap.read_buf);
} }
......
...@@ -1070,7 +1070,7 @@ static int video_release(struct inode *inode, struct file *file) ...@@ -1070,7 +1070,7 @@ static int video_release(struct inode *inode, struct file *file)
res_free(dev,fh,RESOURCE_VIDEO); res_free(dev,fh,RESOURCE_VIDEO);
} }
if (fh->vidq.read_buf) { if (fh->vidq.read_buf) {
buffer_release(file->private_data,fh->vidq.read_buf); buffer_release(&fh->vidq,fh->vidq.read_buf);
kfree(fh->vidq.read_buf); kfree(fh->vidq.read_buf);
} }
......
...@@ -1305,11 +1305,11 @@ video_poll(struct file *file, struct poll_table_struct *wait) ...@@ -1305,11 +1305,11 @@ video_poll(struct file *file, struct poll_table_struct *wait)
up(&fh->cap.lock); up(&fh->cap.lock);
return POLLERR; return POLLERR;
} }
if (0 != fh->cap.ops->buf_prepare(file->private_data,fh->cap.read_buf,fh->cap.field)) { if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) {
up(&fh->cap.lock); up(&fh->cap.lock);
return POLLERR; return POLLERR;
} }
fh->cap.ops->buf_queue(file->private_data,fh->cap.read_buf); fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
fh->cap.read_off = 0; fh->cap.read_off = 0;
} }
up(&fh->cap.lock); up(&fh->cap.lock);
...@@ -1346,7 +1346,7 @@ static int video_release(struct inode *inode, struct file *file) ...@@ -1346,7 +1346,7 @@ static int video_release(struct inode *inode, struct file *file)
res_free(dev,fh,RESOURCE_VIDEO); res_free(dev,fh,RESOURCE_VIDEO);
} }
if (fh->cap.read_buf) { if (fh->cap.read_buf) {
buffer_release(file->private_data,fh->cap.read_buf); buffer_release(&fh->cap,fh->cap.read_buf);
kfree(fh->cap.read_buf); kfree(fh->cap.read_buf);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment