staging: bcm: use kzalloc instead of kmalloc/memset
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 7 May 2014 06:01:04 +0000 (15:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 11:52:21 +0000 (20:52 +0900)
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/InterfaceDld.c

index 005e4607b2600770f35e7647cf841899c6d46440..e1925bdc127c6e001972069ed1091d473dad4a0d 100644 (file)
@@ -53,8 +53,8 @@ int InterfaceFileReadbackFromChip(PVOID arg, struct file *flp,
        struct bcm_interface_adapter *psIntfAdapter = arg;
        int bytes;
 
-       buff = kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_DMA);
-       buff_readback = kmalloc(MAX_TRANSFER_CTRL_BYTE_USB , GFP_DMA);
+       buff = kzalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_DMA);
+       buff_readback = kzalloc(MAX_TRANSFER_CTRL_BYTE_USB , GFP_DMA);
        if (!buff || !buff_readback) {
                kfree(buff);
                kfree(buff_readback);
@@ -64,8 +64,6 @@ int InterfaceFileReadbackFromChip(PVOID arg, struct file *flp,
 
        is_config_file = (on_chip_loc == CONFIG_BEGIN_ADDR) ? 1 : 0;
 
-       memset(buff_readback, 0, MAX_TRANSFER_CTRL_BYTE_USB);
-       memset(buff, 0, MAX_TRANSFER_CTRL_BYTE_USB);
        while (1) {
                oldfs = get_fs();
                set_fs(get_ds());