We leaked buffers every time a device was removed, if the user had enabled
sliced VBI insertion into the MPEG stream.  MythTV uses that.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
 {
        struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
        struct cx18 *cx = to_cx18(v4l2_dev);
+       int i;
 
        CX18_DEBUG_INFO("Removing Card\n");
 
        release_mem_region(cx->base_addr, CX18_MEM_SIZE);
 
        pci_disable_device(cx->pci_dev);
-       /* FIXME - we leak cx->vbi.sliced_mpeg_data[i] allocations */
+
+       if (cx->vbi.sliced_mpeg_data[0] != NULL)
+               for (i = 0; i < CX18_VBI_FRAMES; i++)
+                       kfree(cx->vbi.sliced_mpeg_data[i]);
 
        CX18_INFO("Removed %s\n", cx->card_name);