aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/usbatm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index b178c800ced8..bb1db1959854 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -949,7 +949,6 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
949 struct usb_device *usb_dev = interface_to_usbdev(intf); 949 struct usb_device *usb_dev = interface_to_usbdev(intf);
950 struct usbatm_data *instance; 950 struct usbatm_data *instance;
951 char *buf; 951 char *buf;
952 size_t instance_size = sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs);
953 int error = -ENOMEM; 952 int error = -ENOMEM;
954 int i, length; 953 int i, length;
955 int need_heavy; 954 int need_heavy;
@@ -961,14 +960,12 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
961 intf->altsetting->desc.bInterfaceNumber); 960 intf->altsetting->desc.bInterfaceNumber);
962 961
963 /* instance init */ 962 /* instance init */
964 instance = kmalloc(instance_size, GFP_KERNEL); 963 instance = kcalloc(1, sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL);
965 if (!instance) { 964 if (!instance) {
966 dev_dbg(dev, "%s: no memory for instance data!\n", __func__); 965 dev_dbg(dev, "%s: no memory for instance data!\n", __func__);
967 return -ENOMEM; 966 return -ENOMEM;
968 } 967 }
969 968
970 memset(instance, 0, instance_size);
971
972 /* public fields */ 969 /* public fields */
973 970
974 instance->driver = driver; 971 instance->driver = driver;