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>
        struct tm6000_fh     *fh  = vq->priv_data;
        struct tm6000_buffer *buf = container_of(vb, struct tm6000_buffer, vb);
        struct tm6000_core   *dev = fh->dev;
-       int rc = 0, urb_init = 0;
+       int rc = 0;
 
        BUG_ON(NULL == fh->fmt);
 
                rc = videobuf_iolock(vq, &buf->vb, NULL);
                if (rc != 0)
                        goto fail;
-               urb_init = 1;
        }
 
-       if (!dev->isoc_ctl.num_bufs)
-               urb_init = 1;
-
-       if (urb_init) {
+       if (!dev->isoc_ctl.num_bufs) {
                rc = tm6000_prepare_isoc(dev);
                if (rc < 0)
                        goto fail;