Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3698
b: refs/heads/master
c: 65412e4
h: refs/heads/master
v: v3
  • Loading branch information
Duncan Sands authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent 33455c3 commit fc454c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e20d6645f794b51835e6f740a5b6f95c7e3fd843
refs/heads/master: 65412e48e21ff4fdaf2aea1565ef4fb3ef5262ce
9 changes: 5 additions & 4 deletions trunk/drivers/usb/atm/usbatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
struct usb_device *usb_dev = interface_to_usbdev(intf);
struct usbatm_data *instance;
char *buf;
size_t instance_size = sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs);
int error = -ENOMEM;
int i, length;
int need_heavy;
Expand All @@ -960,14 +961,13 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
intf->altsetting->desc.bInterfaceNumber);

/* instance init */
instance = kmalloc(sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs),
GFP_KERNEL);
instance = kmalloc(instance_size, GFP_KERNEL);
if (!instance) {
dev_dbg(dev, "%s: no memory for instance data!\n", __func__);
return -ENOMEM;
}

memset(instance, 0, sizeof(*instance));
memset(instance, 0, instance_size);

/* public fields */

Expand Down Expand Up @@ -1051,6 +1051,8 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
goto fail_unbind;
}

instance->urbs[i] = urb;

buffer = kmalloc(channel->buf_size, GFP_KERNEL);
if (!buffer) {
dev_dbg(dev, "%s: no memory for buffer %d!\n", __func__, i);
Expand Down Expand Up @@ -1078,7 +1080,6 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,

vdbg("%s: alloced buffer 0x%p buf size %u urb 0x%p",
__func__, urb->transfer_buffer, urb->transfer_buffer_length, urb);
instance->urbs[i] = urb;
}

if (need_heavy && driver->heavy_init) {
Expand Down

0 comments on commit fc454c0

Please sign in to comment.