staging: vme_user: change kmalloc+memset to kzalloc
authorManohar Vanga <manohar.vanga@cern.ch>
Mon, 1 Aug 2011 10:20:46 +0000 (12:20 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 22:05:02 +0000 (15:05 -0700)
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/vme/devices/vme_user.c

index 91d2cc7bb4c33fd41db43fc4553bde4d99b85853..3cbeb2ada4186179138753117fd08863ff0a6f81 100644 (file)
@@ -651,7 +651,7 @@ static int __init vme_user_init(void)
 
 
        /* Dynamically create the bind table based on module parameters */
-       ids = kmalloc(sizeof(struct vme_device_id) * (bus_num + 1), GFP_KERNEL);
+       ids = kzalloc(sizeof(struct vme_device_id) * (bus_num + 1), GFP_KERNEL);
        if (ids == NULL) {
                printk(KERN_ERR "%s: Unable to allocate ID table\n",
                        driver_name);
@@ -659,8 +659,6 @@ static int __init vme_user_init(void)
                goto err_id;
        }
 
-       memset(ids, 0, (sizeof(struct vme_device_id) * (bus_num + 1)));
-
        for (i = 0; i < bus_num; i++) {
                ids[i].bus = bus[i];
                /*