mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
[PATCH] USB: kzalloc in PhidgetServo
another 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
17590840dc
commit
d874a2bade
1 changed files with 1 additions and 2 deletions
|
@ -252,12 +252,11 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
|
|||
struct usb_device *udev = interface_to_usbdev(interface);
|
||||
struct phidget_servo *dev;
|
||||
|
||||
dev = kmalloc(sizeof (struct phidget_servo), GFP_KERNEL);
|
||||
dev = kzalloc(sizeof (struct phidget_servo), GFP_KERNEL);
|
||||
if (dev == NULL) {
|
||||
dev_err(&interface->dev, "%s - out of memory\n", __FUNCTION__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(dev, 0x00, sizeof (*dev));
|
||||
|
||||
dev->udev = usb_get_dev(udev);
|
||||
dev->type = id->driver_info;
|
||||
|
|
Loading…
Reference in a new issue