Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42ad4a8d authored by Devendra Naga's avatar Devendra Naga Committed by Greg Kroah-Hartman
Browse files

staging/ft1000: use kzalloc to allocate the ft1000_device structure



with kzalloc the allocate memory is set to zero, so no need of
calling memset again on the allocated memory

Signed-off-by: default avatarDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b10c0b92
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -67,15 +67,13 @@ static int ft1000_probe(struct usb_interface *interface,
	struct ft1000_info *pft1000info = NULL;
	struct ft1000_info *pft1000info = NULL;
	const struct firmware *dsp_fw;
	const struct firmware *dsp_fw;


	ft1000dev = kmalloc(sizeof(struct ft1000_device), GFP_KERNEL);
	ft1000dev = kzalloc(sizeof(struct ft1000_device), GFP_KERNEL);


	if (!ft1000dev) {
	if (!ft1000dev) {
		printk(KERN_ERR "out of memory allocating device structure\n");
		printk(KERN_ERR "out of memory allocating device structure\n");
		return -ENOMEM;
		return -ENOMEM;
	}
	}


	memset(ft1000dev, 0, sizeof(*ft1000dev));

	dev = interface_to_usbdev(interface);
	dev = interface_to_usbdev(interface);
	DEBUG("ft1000_probe: usb device descriptor info:\n");
	DEBUG("ft1000_probe: usb device descriptor info:\n");
	DEBUG("ft1000_probe: number of configuration is %d\n",
	DEBUG("ft1000_probe: number of configuration is %d\n",