Commit 88e834a8 authored by Thierry Reding's avatar Thierry Reding Committed by Mauro Carvalho Chehab

[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: default avatarThierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6f2e77bb
...@@ -754,7 +754,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, ...@@ -754,7 +754,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
struct tm6000_fh *fh = vq->priv_data; struct tm6000_fh *fh = vq->priv_data;
struct tm6000_buffer *buf = container_of(vb, struct tm6000_buffer, vb); struct tm6000_buffer *buf = container_of(vb, struct tm6000_buffer, vb);
struct tm6000_core *dev = fh->dev; struct tm6000_core *dev = fh->dev;
int rc = 0, urb_init = 0; int rc = 0;
BUG_ON(NULL == fh->fmt); BUG_ON(NULL == fh->fmt);
...@@ -780,13 +780,9 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, ...@@ -780,13 +780,9 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
rc = videobuf_iolock(vq, &buf->vb, NULL); rc = videobuf_iolock(vq, &buf->vb, NULL);
if (rc != 0) if (rc != 0)
goto fail; goto fail;
urb_init = 1;
} }
if (!dev->isoc_ctl.num_bufs) if (!dev->isoc_ctl.num_bufs) {
urb_init = 1;
if (urb_init) {
rc = tm6000_prepare_isoc(dev); rc = tm6000_prepare_isoc(dev);
if (rc < 0) if (rc < 0)
goto fail; goto fail;
......
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