Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 3f57fb73696fea31ef6a619b390a707b4091eda9)
+++ uspace/srv/devman/main.c	(revision 8a99c7ed8506480ce279d2129b1efc24cd26f307)
@@ -419,5 +419,7 @@
 	
 	/* Check that function with same name is not there already. */
-	if (find_fun_node_in_device(tree, pdev, fun_name) != NULL) {
+	fun_node_t *tfun = find_fun_node_in_device(tree, pdev, fun_name);
+	if (tfun) {
+		fun_del_ref(tfun);	/* drop the new unwanted reference */
 		fibril_rwlock_write_unlock(&tree->rwlock);
 		dev_del_ref(pdev);
