Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision a3fcfbab8ada7658810ed4966e92d5dc1f3cfec7)
+++ uspace/srv/devman/main.c	(revision 33fc3aeab329e1c9379060b6ba8f5568ad21d9fa)
@@ -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);
