]> err.no Git - linux-2.6/blobdiff - drivers/char/synclink_gt.c
Fix a potential NULL pointer dereference in write_bulk_callback() in drivers/net...
[linux-2.6] / drivers / char / synclink_gt.c
index 428b514201f4654bfbb97beddaeef00b85bb6e9c..372a37e256208b30711e2ee1e3809f120c5b25cc 100644 (file)
@@ -3414,13 +3414,12 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
 {
        struct slgt_info *info;
 
-       info = kmalloc(sizeof(struct slgt_info), GFP_KERNEL);
+       info = kzalloc(sizeof(struct slgt_info), GFP_KERNEL);
 
        if (!info) {
                DBGERR(("%s device alloc failed adapter=%d port=%d\n",
                        driver_name, adapter_num, port_num));
        } else {
-               memset(info, 0, sizeof(struct slgt_info));
                info->magic = MGSL_MAGIC;
                INIT_WORK(&info->task, bh_handler);
                info->max_frame_size = 4096;