aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/usbatm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/atm/usbatm.c')
-rw-r--r--drivers/usb/atm/usbatm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 2eb8552dac12..3ed5f02c36d3 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -763,13 +763,12 @@ static int usbatm_atm_open(struct atm_vcc *vcc)
763 goto fail; 763 goto fail;
764 } 764 }
765 765
766 if (!(new = kmalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { 766 if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) {
767 atm_err(instance, "%s: no memory for vcc_data!\n", __func__); 767 atm_err(instance, "%s: no memory for vcc_data!\n", __func__);
768 ret = -ENOMEM; 768 ret = -ENOMEM;
769 goto fail; 769 goto fail;
770 } 770 }
771 771
772 memset(new, 0, sizeof(struct usbatm_vcc_data));
773 new->vcc = vcc; 772 new->vcc = vcc;
774 new->vpi = vpi; 773 new->vpi = vpi;
775 new->vci = vci; 774 new->vci = vci;
@@ -1066,13 +1065,12 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
1066 1065
1067 instance->urbs[i] = urb; 1066 instance->urbs[i] = urb;
1068 1067
1069 buffer = kmalloc(channel->buf_size, GFP_KERNEL); 1068 /* zero the tx padding to avoid leaking information */
1069 buffer = kzalloc(channel->buf_size, GFP_KERNEL);
1070 if (!buffer) { 1070 if (!buffer) {
1071 dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i); 1071 dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i);
1072 goto fail_unbind; 1072 goto fail_unbind;
1073 } 1073 }
1074 /* zero the tx padding to avoid leaking information */
1075 memset(buffer, 0, channel->buf_size);
1076 1074
1077 usb_fill_bulk_urb(urb, instance->usb_dev, channel->endpoint, 1075 usb_fill_bulk_urb(urb, instance->usb_dev, channel->endpoint,
1078 buffer, channel->buf_size, usbatm_complete, channel); 1076 buffer, channel->buf_size, usbatm_complete, channel);