aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2011-08-04 03:14:12 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-31 16:21:08 -0400
commit88e834a841bde22b4c0aa71809e02c118c5b219d (patch)
treed54c6733024e04bd479e8310858410c2ac3ab815 /drivers/staging
parent6f2e77bb955771a7b8de80ea519c1e9a82b864dd (diff)
[media] tm6000: Initialize isochronous transfers only once
This fixes a memory leak where isochronous buffers would be set up for each video buffer, while it is sufficient to set them up only once per device. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/tm6000/tm6000-video.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c
index bef6023424af..873c8ee8b3ba 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -754,7 +754,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
754 struct tm6000_fh *fh = vq->priv_data; 754 struct tm6000_fh *fh = vq->priv_data;
755 struct tm6000_buffer *buf = container_of(vb, struct tm6000_buffer, vb); 755 struct tm6000_buffer *buf = container_of(vb, struct tm6000_buffer, vb);
756 struct tm6000_core *dev = fh->dev; 756 struct tm6000_core *dev = fh->dev;
757 int rc = 0, urb_init = 0; 757 int rc = 0;
758 758
759 BUG_ON(NULL == fh->fmt); 759 BUG_ON(NULL == fh->fmt);
760 760
@@ -780,13 +780,9 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
780 rc = videobuf_iolock(vq, &buf->vb, NULL); 780 rc = videobuf_iolock(vq, &buf->vb, NULL);
781 if (rc != 0) 781 if (rc != 0)
782 goto fail; 782 goto fail;
783 urb_init = 1;
784 } 783 }
785 784
786 if (!dev->isoc_ctl.num_bufs) 785 if (!dev->isoc_ctl.num_bufs) {
787 urb_init = 1;
788
789 if (urb_init) {
790 rc = tm6000_prepare_isoc(dev); 786 rc = tm6000_prepare_isoc(dev);
791 if (rc < 0) 787 if (rc < 0)
792 goto fail; 788 goto fail;