[media] drivers/media/video/zr364xx.c: add missing cleanup code
authorJulia Lawall <julia@diku.dk>
Fri, 12 Aug 2011 11:40:08 +0000 (08:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 3 Sep 2011 21:43:58 +0000 (18:43 -0300)
It seems just as necessary to free cam->vdev and cam in this error case as
in the next one.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/zr364xx.c

index c492846c1c5a33770c6488cbfd8095f7c91757db..e78cf94f491e76ff8eca011c9d92cc6a313141ad 100644 (file)
@@ -1638,6 +1638,9 @@ static int zr364xx_probe(struct usb_interface *intf,
 
        if (!cam->read_endpoint) {
                dev_err(&intf->dev, "Could not find bulk-in endpoint\n");
+               video_device_release(cam->vdev);
+               kfree(cam);
+               cam = NULL;
                return -ENOMEM;
        }