Commit 4d96c2a7 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: video-buf update

- Fix a memory leak in video-buf.c
- Small update for the video-buf-dvb.c module.
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 64a74347
/* /*
* $Id: video-buf-dvb.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ * $Id: video-buf-dvb.c,v 1.7 2004/12/09 12:51:35 kraxel Exp $
* *
* some helper function for simple DVB cards which simply DMA the * some helper function for simple DVB cards which simply DMA the
* complete transport stream and let the computer sort everything else * complete transport stream and let the computer sort everything else
...@@ -35,7 +35,7 @@ module_param(debug, int, 0644); ...@@ -35,7 +35,7 @@ module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages"); MODULE_PARM_DESC(debug,"enable debug messages");
#define dprintk(fmt, arg...) if (debug) \ #define dprintk(fmt, arg...) if (debug) \
printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name, ## arg) printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name , ## arg)
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
...@@ -134,19 +134,22 @@ static int videobuf_dvb_stop_feed(struct dvb_demux_feed *feed) ...@@ -134,19 +134,22 @@ static int videobuf_dvb_stop_feed(struct dvb_demux_feed *feed)
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
int videobuf_dvb_register(struct videobuf_dvb *dvb) int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv)
{ {
int result; int result;
init_MUTEX(&dvb->lock); init_MUTEX(&dvb->lock);
/* register adapter */ /* register adapter */
result = dvb_register_adapter(&dvb->adapter, dvb->name, THIS_MODULE); result = dvb_register_adapter(&dvb->adapter, dvb->name, module);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n", printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
dvb->name, result); dvb->name, result);
goto fail_adapter; goto fail_adapter;
} }
dvb->adapter->priv = adapter_priv;
/* register frontend */ /* register frontend */
result = dvb_register_frontend(dvb->adapter, dvb->frontend); result = dvb_register_frontend(dvb->adapter, dvb->frontend);
......
/* /*
* $Id: video-buf.c,v 1.15 2004/11/07 14:45:00 kraxel Exp $ * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
* *
* generic helper functions for video4linux capture buffers, to handle * generic helper functions for video4linux capture buffers, to handle
* memory management and PCI DMA. Right now bttv + saa7134 use it. * memory management and PCI DMA. Right now bttv + saa7134 use it.
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -892,6 +893,7 @@ void videobuf_read_stop(struct videobuf_queue *q) ...@@ -892,6 +893,7 @@ void videobuf_read_stop(struct videobuf_queue *q)
int i; int i;
videobuf_queue_cancel(q); videobuf_queue_cancel(q);
videobuf_mmap_free(q);
INIT_LIST_HEAD(&q->stream); INIT_LIST_HEAD(&q->stream);
for (i = 0; i < VIDEO_MAX_FRAME; i++) { for (i = 0; i < VIDEO_MAX_FRAME; i++) {
if (NULL == q->bufs[i]) if (NULL == q->bufs[i])
......
...@@ -24,7 +24,9 @@ struct videobuf_dvb { ...@@ -24,7 +24,9 @@ struct videobuf_dvb {
struct dvb_net net; struct dvb_net net;
}; };
int videobuf_dvb_register(struct videobuf_dvb *dvb); int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv);
void videobuf_dvb_unregister(struct videobuf_dvb *dvb); void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
/* /*
......
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