aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/goku_udc.c3
-rw-r--r--drivers/usb/gadget/serial.c3
-rw-r--r--drivers/usb/host/ohci-hcd.c3
-rw-r--r--drivers/usb/host/sl811_cs.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index d6c5f1150ae7..349b8166f34a 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1777,14 +1777,13 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1777 } 1777 }
1778 1778
1779 /* alloc, and start init */ 1779 /* alloc, and start init */
1780 dev = kmalloc (sizeof *dev, GFP_KERNEL); 1780 dev = kzalloc (sizeof *dev, GFP_KERNEL);
1781 if (dev == NULL){ 1781 if (dev == NULL){
1782 pr_debug("enomem %s\n", pci_name(pdev)); 1782 pr_debug("enomem %s\n", pci_name(pdev));
1783 retval = -ENOMEM; 1783 retval = -ENOMEM;
1784 goto done; 1784 goto done;
1785 } 1785 }
1786 1786
1787 memset(dev, 0, sizeof *dev);
1788 spin_lock_init(&dev->lock); 1787 spin_lock_init(&dev->lock);
1789 dev->pdev = pdev; 1788 dev->pdev = pdev;
1790 dev->gadget.ops = &goku_ops; 1789 dev->gadget.ops = &goku_ops;
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index dd33ff0ae4ce..38138bb9ddb0 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -1427,7 +1427,7 @@ static int __init gs_bind(struct usb_gadget *gadget)
1427 gs_acm_config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP; 1427 gs_acm_config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
1428 } 1428 }
1429 1429
1430 gs_device = dev = kmalloc(sizeof(struct gs_dev), GFP_KERNEL); 1430 gs_device = dev = kzalloc(sizeof(struct gs_dev), GFP_KERNEL);
1431 if (dev == NULL) 1431 if (dev == NULL)
1432 return -ENOMEM; 1432 return -ENOMEM;
1433 1433
@@ -1435,7 +1435,6 @@ static int __init gs_bind(struct usb_gadget *gadget)
1435 init_utsname()->sysname, init_utsname()->release, 1435 init_utsname()->sysname, init_utsname()->release,
1436 gadget->name); 1436 gadget->name);
1437 1437
1438 memset(dev, 0, sizeof(struct gs_dev));
1439 dev->dev_gadget = gadget; 1438 dev->dev_gadget = gadget;
1440 spin_lock_init(&dev->dev_lock); 1439 spin_lock_init(&dev->dev_lock);
1441 INIT_LIST_HEAD(&dev->dev_req_list); 1440 INIT_LIST_HEAD(&dev->dev_req_list);
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 2038125b7f8c..6edf4097d2d2 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -171,11 +171,10 @@ static int ohci_urb_enqueue (
171 } 171 }
172 172
173 /* allocate the private part of the URB */ 173 /* allocate the private part of the URB */
174 urb_priv = kmalloc (sizeof (urb_priv_t) + size * sizeof (struct td *), 174 urb_priv = kzalloc (sizeof (urb_priv_t) + size * sizeof (struct td *),
175 mem_flags); 175 mem_flags);
176 if (!urb_priv) 176 if (!urb_priv)
177 return -ENOMEM; 177 return -ENOMEM;
178 memset (urb_priv, 0, sizeof (urb_priv_t) + size * sizeof (struct td *));
179 INIT_LIST_HEAD (&urb_priv->pending); 178 INIT_LIST_HEAD (&urb_priv->pending);
180 urb_priv->length = size; 179 urb_priv->length = size;
181 urb_priv->ed = ed; 180 urb_priv->ed = ed;
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index 2d0e73b20099..5da63f535005 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -278,10 +278,9 @@ static int sl811_cs_probe(struct pcmcia_device *link)
278{ 278{
279 local_info_t *local; 279 local_info_t *local;
280 280
281 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 281 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
282 if (!local) 282 if (!local)
283 return -ENOMEM; 283 return -ENOMEM;
284 memset(local, 0, sizeof(local_info_t));
285 local->p_dev = link; 284 local->p_dev = link;
286 link->priv = local; 285 link->priv = local;
287 286