Skip to content

Commit

Permalink
USB: ftdi-elan.c: kmalloc + memset conversion to kzalloc
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
Mariusz Kozlowski authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent b3aceb2 commit 5280d60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/usb/misc/ftdi-elan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2777,12 +2777,14 @@ static int ftdi_elan_probe(struct usb_interface *interface,
size_t buffer_size;
int i;
int retval = -ENOMEM;
struct usb_ftdi *ftdi = kmalloc(sizeof(struct usb_ftdi), GFP_KERNEL);
if (ftdi == NULL) {
struct usb_ftdi *ftdi;

ftdi = kzalloc(sizeof(struct usb_ftdi), GFP_KERNEL);
if (!ftdi) {
printk(KERN_ERR "Out of memory\n");
return -ENOMEM;
}
memset(ftdi, 0x00, sizeof(struct usb_ftdi));

mutex_lock(&ftdi_module_lock);
list_add_tail(&ftdi->ftdi_list, &ftdi_static_list);
ftdi->sequence_num = ++ftdi_instances;
Expand Down

0 comments on commit 5280d60

Please sign in to comment.