[PATCH] USB: kzalloc in PhidgetServo
authorOliver Neukum <oliver@neukum.org>
Fri, 6 Jan 2006 21:43:32 +0000 (22:43 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Mar 2006 22:49:53 +0000 (14:49 -0800)
another for kzalloc.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/phidgetservo.c

index b3418d2bcc699257e68698703e544d5a5a844bde..5a040c205eed58f3cb3760a955aaff3cf020dff2 100644 (file)
@@ -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;