staging/ft1000: use kzalloc to allocate the ft1000_device structure
[firefly-linux-kernel-4.4.55.git] / drivers / staging / ft1000 / ft1000-usb / ft1000_usb.c
index 84c38d5c9397dc0ac31ac1a28a6047667f5eabb4..bfead67436fef8203344be92c2cc63b2b4e975a8 100644 (file)
@@ -67,15 +67,13 @@ static int ft1000_probe(struct usb_interface *interface,
        struct ft1000_info *pft1000info = NULL;
        const struct firmware *dsp_fw;
 
-       ft1000dev = kmalloc(sizeof(struct ft1000_device), GFP_KERNEL);
+       ft1000dev = kzalloc(sizeof(struct ft1000_device), GFP_KERNEL);
 
        if (!ft1000dev) {
                printk(KERN_ERR "out of memory allocating device structure\n");
-               return 0;
+               return -ENOMEM;
        }
 
-       memset(ft1000dev, 0, sizeof(*ft1000dev));
-
        dev = interface_to_usbdev(interface);
        DEBUG("ft1000_probe: usb device descriptor info:\n");
        DEBUG("ft1000_probe: number of configuration is %d\n",