Commit 06d69474 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: kzalloc in usbled

another one for kzalloc.
Signed-off-by: default avatarOliver Neukum <oliver@neukum.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d874a2ba
...@@ -106,12 +106,11 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id ...@@ -106,12 +106,11 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id
struct usb_led *dev = NULL; struct usb_led *dev = NULL;
int retval = -ENOMEM; int retval = -ENOMEM;
dev = kmalloc(sizeof(struct usb_led), GFP_KERNEL); dev = kzalloc(sizeof(struct usb_led), GFP_KERNEL);
if (dev == NULL) { if (dev == NULL) {
dev_err(&interface->dev, "Out of memory\n"); dev_err(&interface->dev, "Out of memory\n");
goto error; goto error;
} }
memset (dev, 0x00, sizeof (*dev));
dev->udev = usb_get_dev(udev); dev->udev = usb_get_dev(udev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment