Skip to content

Commit

Permalink
dwc_otg: Use kzalloc when suitable
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno George de Moraes authored and popcornmix committed Aug 30, 2016
1 parent a1fe720 commit 8a6e7f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/host/dwc_otg/dummy_audio.c
Expand Up @@ -1377,10 +1377,9 @@ zero_bind (struct usb_gadget *gadget)


/* ok, we made sense of the hardware ... */
dev = kmalloc (sizeof *dev, SLAB_KERNEL);
dev = kzalloc (sizeof *dev, SLAB_KERNEL);
if (!dev)
return -ENOMEM;
memset (dev, 0, sizeof *dev);
spin_lock_init (&dev->lock);
dev->gadget = gadget;
set_gadget_data (gadget, dev);
Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c
Expand Up @@ -212,12 +212,11 @@ static struct usb_request *dwc_otg_pcd_alloc_request(struct usb_ep *ep,
DWC_WARN("%s() %s\n", __func__, "Invalid EP!\n");
return 0;
}
usb_req = kmalloc(sizeof(*usb_req), gfp_flags);
usb_req = kzalloc(sizeof(*usb_req), gfp_flags);
if (0 == usb_req) {
DWC_WARN("%s() %s\n", __func__, "request allocation failed!\n");
return 0;
}
memset(usb_req, 0, sizeof(*usb_req));
usb_req->dma = DWC_DMA_ADDR_INVALID;

return usb_req;
Expand Down

0 comments on commit 8a6e7f5

Please sign in to comment.