* [PATCH 2/3] staging/ft1000: use kzalloc to allocate the ft1000_device structure
@ 2012-06-19 16:22 Devendra Naga
0 siblings, 0 replies; only message in thread
From: Devendra Naga @ 2012-06-19 16:22 UTC (permalink / raw)
To: Marek Belisko, Greg Kroah-Hartman, devel, linux-kernel; +Cc: Devendra Naga
with kzalloc the allocate memory is set to zero, so no need of
calling memset again on the allocated memory
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index a07c504..bfead67 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -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 -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",
--
1.7.9.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-19 16:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 16:22 [PATCH 2/3] staging/ft1000: use kzalloc to allocate the ft1000_device structure Devendra Naga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome