浏览代码

[PATCH] USB: kzalloc in idmouse

another for kzalloc.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Oliver Neukum 19 年之前
父节点
当前提交
092e462a53
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/usb/misc/idmouse.c

+ 1 - 2
drivers/usb/misc/idmouse.c

@@ -340,10 +340,9 @@ static int idmouse_probe(struct usb_interface *interface,
 		return -ENODEV;
 
 	/* allocate memory for our device state and initialize it */
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (dev == NULL)
 		return -ENOMEM;
-	memset(dev, 0x00, sizeof(*dev));
 
 	init_MUTEX(&dev->sem);
 	dev->udev = udev;