Index: uspace/drv/ohci/batch.c
===================================================================
--- uspace/drv/ohci/batch.c	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/drv/ohci/batch.c	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -43,15 +43,22 @@
 #include "hw_struct/transfer_descriptor.h"
 
-typedef struct ohci_batch {
+typedef struct ohci_transfer_batch {
 	ed_t *ed;
 	td_t *tds;
 	size_t td_count;
-} ohci_batch_t;
+} ohci_transfer_batch_t;
+
+static void ohci_transfer_batch_dispose(void *ohci_batch)
+{
+	//TODO: add buffer disposal
+	ohci_transfer_batch_t *instance = ohci_batch;
+	assert(instance);
+	free32(instance->ed);
+	free32(instance->tds);
+}
 
 static void batch_control(usb_transfer_batch_t *instance,
     usb_direction_t data_dir, usb_direction_t status_dir);
 static void batch_data(usb_transfer_batch_t *instance);
-static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
-static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
 
 #define DEFAULT_ERROR_COUNT 3
@@ -65,5 +72,5 @@
                 usb_log_error(message); \
                 if (instance) { \
-                        batch_dispose(instance); \
+                        usb_transfer_batch_dispose(instance); \
                 } \
                 return NULL; \
@@ -74,9 +81,10 @@
 	    "Failed to allocate batch instance.\n");
 	usb_transfer_batch_init(instance, ep, buffer, NULL, buffer_size,
-	    NULL, setup_size, func_in, func_out, arg, fun, NULL);
-
-	ohci_batch_t *data = malloc(sizeof(ohci_batch_t));
+	    NULL, setup_size, func_in, func_out, arg, fun, NULL,
+	    ohci_transfer_batch_dispose);
+
+	ohci_transfer_batch_t *data = malloc(sizeof(ohci_transfer_batch_t));
 	CHECK_NULL_DISPOSE_RETURN(data, "Failed to allocate batch data.\n");
-	bzero(data, sizeof(ohci_batch_t));
+	bzero(data, sizeof(ohci_transfer_batch_t));
 	instance->private_data = data;
 
@@ -113,21 +121,8 @@
 }
 /*----------------------------------------------------------------------------*/
-void batch_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	ohci_batch_t *data = instance->private_data;
-	assert(data);
-	free32(data->ed);
-	free32(data->tds);
-	free32(instance->setup_buffer);
-	free32(instance->data_buffer);
-	free(data);
-	free(instance);
-}
-/*----------------------------------------------------------------------------*/
 bool batch_is_complete(usb_transfer_batch_t *instance)
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	size_t tds = data->td_count - 1;
@@ -163,5 +158,5 @@
 	/* We are data out, we are supposed to provide data */
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	batch_control(instance, USB_DIRECTION_OUT, USB_DIRECTION_IN);
 	usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance);
@@ -171,5 +166,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_control(instance, USB_DIRECTION_IN, USB_DIRECTION_OUT);
 	usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance);
@@ -179,5 +174,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance);
@@ -189,5 +184,5 @@
 	/* We are data out, we are supposed to provide data */
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance);
@@ -197,5 +192,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
@@ -205,5 +200,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
@@ -213,5 +208,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	return data->ed;
@@ -222,5 +217,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	ed_init(data->ed, instance->ep);
@@ -270,5 +265,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	ed_init(data->ed, instance->ep);
@@ -299,26 +294,4 @@
 	}
 }
-/*----------------------------------------------------------------------------*/
-/** Helper function calls callback and correctly disposes of batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_in(instance);
-	batch_dispose(instance);
-}
-/*----------------------------------------------------------------------------*/
-/** Helper function calls callback and correctly disposes of batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_out(instance);
-	batch_dispose(instance);
-}
 /**
  * @}
Index: uspace/drv/ohci/batch.h
===================================================================
--- uspace/drv/ohci/batch.h	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/drv/ohci/batch.h	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -50,6 +50,4 @@
     void *arg);
 
-void batch_dispose(usb_transfer_batch_t *instance);
-
 bool batch_is_complete(usb_transfer_batch_t *instance);
 
Index: uspace/drv/ohci/iface.c
===================================================================
--- uspace/drv/ohci/iface.c	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/drv/ohci/iface.c	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -228,5 +228,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -262,5 +262,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -296,5 +296,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -330,5 +330,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -370,5 +370,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -409,5 +409,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
Index: uspace/drv/uhci-hcd/batch.c
===================================================================
--- uspace/drv/uhci-hcd/batch.c	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/drv/uhci-hcd/batch.c	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -45,16 +45,23 @@
 #define DEFAULT_ERROR_COUNT 3
 
-typedef struct uhci_batch {
+typedef struct uhci_transfer_batch {
 	qh_t *qh;
 	td_t *tds;
+	void *device_buffer;
 	size_t td_count;
-} uhci_batch_t;
+} uhci_transfer_batch_t;
+/*----------------------------------------------------------------------------*/
+static void uhci_transfer_batch_dispose(void *uhci_batch)
+{
+	uhci_transfer_batch_t *instance = uhci_batch;
+	assert(instance);
+	free32(instance->device_buffer);
+	free(instance);
+}
+/*----------------------------------------------------------------------------*/
 
 static void batch_control(usb_transfer_batch_t *instance,
     usb_packet_id data_stage, usb_packet_id status_stage);
 static void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid);
-static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
-static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
-
 
 /** Allocate memory and initialize internal data structure.
@@ -88,55 +95,51 @@
 	if (ptr == NULL) { \
 		usb_log_error(message); \
-		if (instance) { \
-			batch_dispose(instance); \
+		if (uhci_data) { \
+			uhci_transfer_batch_dispose(uhci_data); \
 		} \
 		return NULL; \
 	} else (void)0
 
+	uhci_transfer_batch_t *uhci_data =
+	    malloc(sizeof(uhci_transfer_batch_t));
+	CHECK_NULL_DISPOSE_RETURN(uhci_data,
+	    "Failed to allocate UHCI batch.\n");
+	bzero(uhci_data, sizeof(uhci_transfer_batch_t));
+
+	uhci_data->td_count =
+	    (buffer_size + ep->max_packet_size - 1) / ep->max_packet_size;
+	if (ep->transfer_type == USB_TRANSFER_CONTROL) {
+		uhci_data->td_count += 2;
+	}
+
+	assert((sizeof(td_t) % 16) == 0);
+	const size_t total_size = (sizeof(td_t) * uhci_data->td_count)
+	    + sizeof(qh_t) + setup_size + buffer_size;
+	uhci_data->device_buffer = malloc32(total_size);
+	CHECK_NULL_DISPOSE_RETURN(uhci_data->device_buffer,
+	    "Failed to allocate UHCI buffer.\n");
+	bzero(uhci_data->device_buffer, total_size);
+
+	uhci_data->tds = uhci_data->device_buffer;
+	uhci_data->qh =
+	    (uhci_data->device_buffer + (sizeof(td_t) * uhci_data->td_count));
+
+	qh_init(uhci_data->qh);
+	qh_set_element_td(uhci_data->qh, addr_to_phys(uhci_data->tds));
+
 	usb_transfer_batch_t *instance = malloc(sizeof(usb_transfer_batch_t));
 	CHECK_NULL_DISPOSE_RETURN(instance,
 	    "Failed to allocate batch instance.\n");
+	void *setup =
+	    uhci_data->device_buffer + (sizeof(td_t) * uhci_data->td_count)
+	    + sizeof(qh_t);
+	void *data_buffer = setup + setup_size;
 	usb_target_t target =
 	    { .address = ep->address, .endpoint = ep->endpoint };
-	usb_transfer_batch_init(instance, ep,
-	    buffer, NULL, buffer_size, NULL, setup_size,
-	    func_in, func_out, arg, fun, NULL);
-
-
-	uhci_batch_t *data = malloc(sizeof(uhci_batch_t));
-	CHECK_NULL_DISPOSE_RETURN(data, "Failed to allocate batch data.\n");
-	bzero(data, sizeof(uhci_batch_t));
-	instance->private_data = data;
-
-	data->td_count =
-	    (buffer_size + ep->max_packet_size - 1) / ep->max_packet_size;
-	if (ep->transfer_type == USB_TRANSFER_CONTROL) {
-		data->td_count += 2;
-	}
-
-	data->tds = malloc32(sizeof(td_t) * data->td_count);
-	CHECK_NULL_DISPOSE_RETURN(
-	    data->tds, "Failed to allocate transfer descriptors.\n");
-	bzero(data->tds, sizeof(td_t) * data->td_count);
-
-	data->qh = malloc32(sizeof(qh_t));
-	CHECK_NULL_DISPOSE_RETURN(data->qh,
-	    "Failed to allocate batch queue head.\n");
-	qh_init(data->qh);
-	qh_set_element_td(data->qh, addr_to_phys(data->tds));
-
-	if (buffer_size > 0) {
-		instance->data_buffer = malloc32(buffer_size);
-		CHECK_NULL_DISPOSE_RETURN(instance->data_buffer,
-		    "Failed to allocate device accessible buffer.\n");
-	}
-
-	if (setup_size > 0) {
-		instance->setup_buffer = malloc32(setup_size);
-		CHECK_NULL_DISPOSE_RETURN(instance->setup_buffer,
-		    "Failed to allocate device accessible setup buffer.\n");
-		memcpy(instance->setup_buffer, setup_buffer, setup_size);
-	}
-
+	usb_transfer_batch_init(instance, ep, buffer, data_buffer, buffer_size,
+	    setup, setup_size, func_in, func_out, arg, fun,
+	    uhci_data, uhci_transfer_batch_dispose);
+
+	memcpy(instance->setup_buffer, setup_buffer, setup_size);
 	usb_log_debug("Batch(%p) %d:%d memory structures ready.\n",
 	    instance, target.address, target.endpoint);
@@ -156,5 +159,5 @@
 {
 	assert(instance);
-	uhci_batch_t *data = instance->private_data;
+	uhci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 
@@ -203,5 +206,5 @@
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
 	batch_control(instance, USB_PID_OUT, USB_PID_IN);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance);
 }
@@ -217,5 +220,5 @@
 	assert(instance);
 	batch_control(instance, USB_PID_IN, USB_PID_OUT);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance);
 }
@@ -231,5 +234,5 @@
 	assert(instance);
 	batch_data(instance, USB_PID_IN);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance);
 }
@@ -247,5 +250,5 @@
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
 	batch_data(instance, USB_PID_OUT);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance);
 }
@@ -261,5 +264,5 @@
 	assert(instance);
 	batch_data(instance, USB_PID_IN);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
 }
@@ -277,5 +280,5 @@
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
 	batch_data(instance, USB_PID_OUT);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance);
 }
@@ -292,5 +295,5 @@
 {
 	assert(instance);
-	uhci_batch_t *data = instance->private_data;
+	uhci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 
@@ -344,5 +347,5 @@
 {
 	assert(instance);
-	uhci_batch_t *data = instance->private_data;
+	uhci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	assert(data->td_count >= 2);
@@ -396,49 +399,8 @@
 {
 	assert(instance);
-	uhci_batch_t *data = instance->private_data;
+	uhci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	return data->qh;
 }
-/*----------------------------------------------------------------------------*/
-/** Helper function, calls callback and correctly destroys batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_in(instance);
-	batch_dispose(instance);
-}
-/*----------------------------------------------------------------------------*/
-/** Helper function calls callback and correctly destroys batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_out(instance);
-	batch_dispose(instance);
-}
-/*----------------------------------------------------------------------------*/
-/** Correctly dispose all used data structures.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	uhci_batch_t *data = instance->private_data;
-	assert(data);
-	usb_log_debug("Batch(%p) disposing.\n", instance);
-	/* free32 is NULL safe */
-	free32(data->tds);
-	free32(data->qh);
-	free32(instance->setup_buffer);
-	free32(instance->data_buffer);
-	free(data);
-	free(instance);
-}
 /**
  * @}
Index: uspace/drv/uhci-hcd/iface.c
===================================================================
--- uspace/drv/uhci-hcd/iface.c	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/drv/uhci-hcd/iface.c	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -195,5 +195,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -223,5 +223,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -251,5 +251,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -279,5 +279,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -312,5 +312,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
@@ -344,5 +344,5 @@
 	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
-		batch_dispose(batch);
+		usb_transfer_batch_dispose(batch);
 	}
 	return ret;
Index: uspace/lib/usb/include/usb/host/batch.h
===================================================================
--- uspace/lib/usb/include/usb/host/batch.h	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/lib/usb/include/usb/host/batch.h	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -58,9 +58,10 @@
 	ddf_fun_t *fun;
 	void *private_data;
+	void (*private_data_dtor)(void *p_data);
 };
 
 void usb_transfer_batch_init(
     usb_transfer_batch_t *instance,
-		endpoint_t *ep,
+    endpoint_t *ep,
     char *buffer,
     char *data_buffer,
@@ -72,16 +73,12 @@
     void *arg,
     ddf_fun_t *fun,
-    void *private_data
+    void *private_data,
+    void (*private_data_dtor)(void *p_data)
 );
 
-static inline usb_transfer_batch_t *usb_transfer_batch_from_link(link_t *l)
-{
-	assert(l);
-	return list_get_instance(l, usb_transfer_batch_t, link);
-}
-
-void usb_transfer_batch_call_in(usb_transfer_batch_t *instance);
-void usb_transfer_batch_call_out(usb_transfer_batch_t *instance);
+void usb_transfer_batch_call_in_and_dispose(usb_transfer_batch_t *instance);
+void usb_transfer_batch_call_out_and_dispose(usb_transfer_batch_t *instance);
 void usb_transfer_batch_finish(usb_transfer_batch_t *instance);
+void usb_transfer_batch_dispose(usb_transfer_batch_t *instance);
 
 static inline void usb_transfer_batch_finish_error(
@@ -93,4 +90,10 @@
 }
 
+static inline usb_transfer_batch_t *usb_transfer_batch_from_link(link_t *l)
+{
+	assert(l);
+	return list_get_instance(l, usb_transfer_batch_t, link);
+}
+
 #endif
 /**
Index: uspace/lib/usb/src/host/batch.c
===================================================================
--- uspace/lib/usb/src/host/batch.c	(revision 910ca3f971a607c0cfe8546c14f33943967cb2bf)
+++ uspace/lib/usb/src/host/batch.c	(revision 2cc6e97ca93ca1ba8d706942d928f0859b7d8107)
@@ -39,7 +39,10 @@
 #include <usb/host/batch.h>
 
+void usb_transfer_batch_call_in(usb_transfer_batch_t *instance);
+void usb_transfer_batch_call_out(usb_transfer_batch_t *instance);
+
 void usb_transfer_batch_init(
     usb_transfer_batch_t *instance,
-		endpoint_t *ep,
+    endpoint_t *ep,
     char *buffer,
     char *data_buffer,
@@ -51,5 +54,6 @@
     void *arg,
     ddf_fun_t *fun,
-    void *private_data
+    void *private_data,
+    void (*private_data_dtor)(void *p_data)
     )
 {
@@ -67,8 +71,31 @@
 	instance->fun = fun;
 	instance->private_data = private_data;
+	instance->private_data_dtor = private_data_dtor;
 	instance->transfered_size = 0;
 	instance->next_step = NULL;
 	instance->error = EOK;
 	endpoint_use(instance->ep);
+}
+/*----------------------------------------------------------------------------*/
+/** Helper function, calls callback and correctly destroys batch structure.
+ *
+ * @param[in] instance Batch structure to use.
+ */
+void usb_transfer_batch_call_in_and_dispose(usb_transfer_batch_t *instance)
+{
+	assert(instance);
+	usb_transfer_batch_call_in(instance);
+	usb_transfer_batch_dispose(instance);
+}
+/*----------------------------------------------------------------------------*/
+/** Helper function calls callback and correctly destroys batch structure.
+ *
+ * @param[in] instance Batch structure to use.
+ */
+void usb_transfer_batch_call_out_and_dispose(usb_transfer_batch_t *instance)
+{
+	assert(instance);
+	usb_transfer_batch_call_out(instance);
+	usb_transfer_batch_dispose(instance);
 }
 /*----------------------------------------------------------------------------*/
@@ -129,4 +156,19 @@
 	    instance->error, instance->arg);
 }
+/*----------------------------------------------------------------------------*/
+/** Correctly dispose all used data structures.
+ *
+ * @param[in] instance Batch structure to use.
+ */
+void usb_transfer_batch_dispose(usb_transfer_batch_t *instance)
+{
+	assert(instance);
+	usb_log_debug("Batch(%p) disposing.\n", instance);
+	if (instance->private_data) {
+		assert(instance->private_data_dtor);
+		instance->private_data_dtor(instance->private_data);
+	}
+	free(instance);
+}
 /**
  * @}
