Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 4a7a8d427937ae0479a15cd9e3a60473b09b1098)
+++ uspace/drv/usbhub/usbhub.c	(revision aca3489ef31598b501c520d461b4eefb5c80f431)
@@ -71,4 +71,7 @@
 
 static void usb_hub_process_global_interrupt(usb_hub_info_t * hub_info);
+
+static void usb_hub_polling_terminted_callback(usb_device_t * device,
+    bool was_error, void * data);
 
 
@@ -351,5 +354,5 @@
 	rc = usb_device_auto_poll(hub_info->usb_device, 0,
 	    hub_port_changes_callback, ((hub_info->port_count + 1) / 8) + 1,
-	    NULL, hub_info);
+	    usb_hub_polling_terminted_callback, hub_info);
 	if (rc != EOK) {
 		usb_log_error("Failed to create polling fibril: %s.\n",
@@ -489,4 +492,23 @@
 
 /**
+ * callback called from hub polling fibril when the fibril terminates
+ *
+ * Should perform a cleanup - deletes hub_info.
+ * @param device usb device afected
+ * @param was_error indicates that the fibril is stoped due to an error
+ * @param data pointer to usb_hub_info_t structure
+ */
+static void usb_hub_polling_terminted_callback(usb_device_t * device,
+    bool was_error, void * data){
+	usb_hub_info_t * hub_info = data;
+	if(!hub_info) return;
+	free(hub_info->ports);
+	free(hub_info);
+}
+
+
+
+
+/**
  * @}
  */
