/* adu_abort_transfers aborts transfers and frees associated data structures  */
static void adu_abort_transfers(struct adu_device *dev)
/* adu_abort_transfers aborts transfers and frees associated data structures  */
static void adu_abort_transfers(struct adu_device *dev)
{
	unsigned long flags;
	dbg(2," %s : enter", __func__);
	if (dev->udev == NULL) {
		dbg(1," %s : udev is null", __func__);
		goto exit;
	}
	spin_lock_irqsave(&dev->buflock, flags);
	if (!dev->read_urb_finished) {
		spin_unlock_irqrestore(&dev->buflock, flags);
		usb_kill_urb(dev->interrupt_in_urb);
	} else
		spin_unlock_irqrestore(&dev->buflock, flags);
	spin_lock_irqsave(&dev->buflock, flags);
	if (!dev->out_urb_finished) {
		spin_unlock_irqrestore(&dev->buflock, flags);
		usb_kill_urb(dev->interrupt_out_urb);
	} else
		spin_unlock_irqrestore(&dev->buflock, flags);
exit:
	dbg(2," %s : leave", __func__);
}