aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 42b0b83d0953..7be69284da03 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1731,6 +1731,12 @@ int gspca_dev_probe(struct usb_interface *intf,
1731 err("couldn't kzalloc gspca struct"); 1731 err("couldn't kzalloc gspca struct");
1732 return -EIO; 1732 return -EIO;
1733 } 1733 }
1734 gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL);
1735 if (!gspca_dev->usb_buf) {
1736 err("out of memory");
1737 ret = -EIO;
1738 goto out;
1739 }
1734 gspca_dev->dev = dev; 1740 gspca_dev->dev = dev;
1735 gspca_dev->iface = interface->bInterfaceNumber; 1741 gspca_dev->iface = interface->bInterfaceNumber;
1736 gspca_dev->nbalt = intf->num_altsetting; 1742 gspca_dev->nbalt = intf->num_altsetting;
@@ -1774,6 +1780,7 @@ int gspca_dev_probe(struct usb_interface *intf,
1774 PDEBUG(D_PROBE, "probe ok"); 1780 PDEBUG(D_PROBE, "probe ok");
1775 return 0; 1781 return 0;
1776out: 1782out:
1783 kfree(gspca_dev->usb_buf);
1777 kfree(gspca_dev); 1784 kfree(gspca_dev);
1778 return ret; 1785 return ret;
1779} 1786}
@@ -1806,6 +1813,7 @@ void gspca_disconnect(struct usb_interface *intf)
1806/* We don't want people trying to open up the device */ 1813/* We don't want people trying to open up the device */
1807 video_unregister_device(&gspca_dev->vdev); 1814 video_unregister_device(&gspca_dev->vdev);
1808/* Free the memory */ 1815/* Free the memory */
1816 kfree(gspca_dev->usb_buf);
1809 kfree(gspca_dev); 1817 kfree(gspca_dev);
1810 PDEBUG(D_PROBE, "disconnect complete"); 1818 PDEBUG(D_PROBE, "disconnect complete");
1811} 1819}