提交 06d69474 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

[PATCH] USB: kzalloc in usbled

another one for kzalloc.
Signed-off-by: NOliver Neukum <oliver@neukum.name>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d874a2ba
......@@ -106,12 +106,11 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id
struct usb_led *dev = NULL;
int retval = -ENOMEM;
dev = kmalloc(sizeof(struct usb_led), GFP_KERNEL);
dev = kzalloc(sizeof(struct usb_led), GFP_KERNEL);
if (dev == NULL) {
dev_err(&interface->dev, "Out of memory\n");
goto error;
}
memset (dev, 0x00, sizeof (*dev));
dev->udev = usb_get_dev(udev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册