[PATCH] USB: kzalloc in cytherm
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:
committed by
Greg Kroah-Hartman
parent
51b208ddf6
commit
5f7481337c
@@ -351,12 +351,11 @@ static int cytherm_probe(struct usb_interface *interface,
|
|||||||
struct usb_cytherm *dev = NULL;
|
struct usb_cytherm *dev = NULL;
|
||||||
int retval = -ENOMEM;
|
int retval = -ENOMEM;
|
||||||
|
|
||||||
dev = kmalloc (sizeof(struct usb_cytherm), GFP_KERNEL);
|
dev = kzalloc (sizeof(struct usb_cytherm), 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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user