Skip to content

Commit

Permalink
Merge pull request martinezjavier#15 from lushl9301/master
Browse files Browse the repository at this point in the history
replace kmalloc with kzalloc
  • Loading branch information
mbgg committed May 8, 2016
2 parents 627686a + cecdb14 commit 5f0ca02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions usb/usb-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,11 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
int retval = -ENOMEM;

/* allocate memory for our device state and initialize it */
dev = kmalloc(sizeof(struct usb_skel), GFP_KERNEL);
if (dev == NULL) {
dev = kzalloc(sizeof(struct usb_skel), GFP_KERNEL);
if (!dev) {
pr_err("Out of memory");
goto error;
}
memset(dev, 0x00, sizeof (*dev));
kref_init(&dev->kref);

dev->udev = usb_get_dev(interface_to_usbdev(interface));
Expand Down

0 comments on commit 5f0ca02

Please sign in to comment.