USB: Fix a memory leak in em28xx_usb_probe()
[cascardo/linux.git] / drivers / media / video / em28xx / em28xx-video.c
index bec6760..40307f3 100644 (file)
@@ -1729,7 +1729,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
 
        endpoint = &interface->cur_altsetting->endpoint[1].desc;
 
-       /* check if the the device has the iso in endpoint at the correct place */
+       /* check if the device has the iso in endpoint at the correct place */
        if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
            USB_ENDPOINT_XFER_ISOC) {
                em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n");
@@ -1772,6 +1772,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
        if (dev->alt_max_pkt_size == NULL) {
                em28xx_errdev("out of memory!\n");
                em28xx_devused&=~(1<<nr);
+               kfree(dev);
                return -ENOMEM;
        }