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)
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;
}
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)
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 {
}
if (!connected(ps->dev)) {
- if (buf)
- kfree(buf);
+ kfree(buf);
return -ENODEV;
}
&& size > 0
&& copy_to_user (ctrl.data, buf, size) != 0)
retval = -EFAULT;
- if (buf != NULL)
- kfree (buf);
+
+ kfree(buf);
return retval;
}