diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-08-10 17:53:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:15 -0400 |
commit | 5280d6083a77cc06a8c8360a2c461fd12d780fb8 (patch) | |
tree | 0c3d7c85111bda26d4766e6d1df08850f84c23e3 /drivers/usb/misc/ftdi-elan.c | |
parent | b3aceb2bab988e514e65dd37f385221a095ad477 (diff) |
USB: ftdi-elan.c: kmalloc + memset conversion to kzalloc
drivers/usb/misc/ftdi-elan.c | 121253 -> 121196 (-57 bytes)
drivers/usb/misc/ftdi-elan.o | 209425 -> 209265 (-160 bytes)
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/ftdi-elan.c')
-rw-r--r-- | drivers/usb/misc/ftdi-elan.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 538b535e955b..d3d8cd6ff103 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c | |||
@@ -2777,12 +2777,14 @@ static int ftdi_elan_probe(struct usb_interface *interface, | |||
2777 | size_t buffer_size; | 2777 | size_t buffer_size; |
2778 | int i; | 2778 | int i; |
2779 | int retval = -ENOMEM; | 2779 | int retval = -ENOMEM; |
2780 | struct usb_ftdi *ftdi = kmalloc(sizeof(struct usb_ftdi), GFP_KERNEL); | 2780 | struct usb_ftdi *ftdi; |
2781 | if (ftdi == NULL) { | 2781 | |
2782 | ftdi = kzalloc(sizeof(struct usb_ftdi), GFP_KERNEL); | ||
2783 | if (!ftdi) { | ||
2782 | printk(KERN_ERR "Out of memory\n"); | 2784 | printk(KERN_ERR "Out of memory\n"); |
2783 | return -ENOMEM; | 2785 | return -ENOMEM; |
2784 | } | 2786 | } |
2785 | memset(ftdi, 0x00, sizeof(struct usb_ftdi)); | 2787 | |
2786 | mutex_lock(&ftdi_module_lock); | 2788 | mutex_lock(&ftdi_module_lock); |
2787 | list_add_tail(&ftdi->ftdi_list, &ftdi_static_list); | 2789 | list_add_tail(&ftdi->ftdi_list, &ftdi_static_list); |
2788 | ftdi->sequence_num = ++ftdi_instances; | 2790 | ftdi->sequence_num = ++ftdi_instances; |