Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282
b: refs/heads/master
c: 6fd19f4
h: refs/heads/master
v: v3
  • Loading branch information
Jesper Juhl authored and Greg K-H committed Apr 19, 2005
1 parent 4163173 commit 214e846
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 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: acbb36f116243bed515357264ecbb6ff9c6d2a5b
refs/heads/master: 6fd19f4b55f7fd1c9d8650bd7f8df2c81b69c5ca
32 changes: 12 additions & 20 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,10 @@ static struct async *alloc_async(unsigned int numisoframes)

static void free_async(struct async *as)
{
if (as->urb->transfer_buffer)
kfree(as->urb->transfer_buffer);
if (as->urb->setup_packet)
kfree(as->urb->setup_packet);
kfree(as->urb->transfer_buffer);
kfree(as->urb->setup_packet);
usb_free_urb(as->urb);
kfree(as);
kfree(as);
}

static inline void async_newpending(struct async *as)
Expand Down Expand Up @@ -938,17 +936,13 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
return -EINVAL;
}
if (!(as = alloc_async(uurb->number_of_packets))) {
if (isopkt)
kfree(isopkt);
if (dr)
kfree(dr);
kfree(isopkt);
kfree(dr);
return -ENOMEM;
}
if (!(as->urb->transfer_buffer = kmalloc(uurb->buffer_length, GFP_KERNEL))) {
if (isopkt)
kfree(isopkt);
if (dr)
kfree(dr);
kfree(isopkt);
kfree(dr);
free_async(as);
return -ENOMEM;
}
Expand All @@ -967,8 +961,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
as->urb->iso_frame_desc[u].length = isopkt[u].length;
totlen += isopkt[u].length;
}
if (isopkt)
kfree(isopkt);
kfree(isopkt);
as->ps = ps;
as->userurb = arg;
if (uurb->endpoint & USB_DIR_IN)
Expand Down Expand Up @@ -1237,7 +1230,7 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
return -ENOMEM;
if ((_IOC_DIR(ctrl.ioctl_code) & _IOC_WRITE)) {
if (copy_from_user (buf, ctrl.data, size)) {
kfree (buf);
kfree(buf);
return -EFAULT;
}
} else {
Expand All @@ -1246,8 +1239,7 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
}

if (!connected(ps->dev)) {
if (buf)
kfree(buf);
kfree(buf);
return -ENODEV;
}

Expand Down Expand Up @@ -1309,8 +1301,8 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
&& size > 0
&& copy_to_user (ctrl.data, buf, size) != 0)
retval = -EFAULT;
if (buf != NULL)
kfree (buf);

kfree(buf);
return retval;
}

Expand Down

0 comments on commit 214e846

Please sign in to comment.