提交 092e462a 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

[PATCH] USB: kzalloc in idmouse

another for kzalloc.
Signed-off-by: NOliver Neukum <oliver@neukum.name>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 5f748133
...@@ -340,10 +340,9 @@ static int idmouse_probe(struct usb_interface *interface, ...@@ -340,10 +340,9 @@ static int idmouse_probe(struct usb_interface *interface,
return -ENODEV; return -ENODEV;
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kmalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) if (dev == NULL)
return -ENOMEM; return -ENOMEM;
memset(dev, 0x00, sizeof(*dev));
init_MUTEX(&dev->sem); init_MUTEX(&dev->sem);
dev->udev = udev; dev->udev = udev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册