mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-17 18:14:34 +08:00
[PATCH] USB: kzalloc in usbled
another one for kzalloc. Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d874a2bade
commit
06d694748b
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user