Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 0db0df2acaf79a846301b8337ca8d67aee9c1f18)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 48cc66faec96bc448eb5c1a946b6c0f2f7890b04)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2026 Jiri Svoboda
  * Copyright (c) 2008 Jakub Jermar
  * All rights reserved.
@@ -276,11 +277,12 @@
 	ht_link_t *lnk = hash_table_find(&nodes, &key);
 
-	if (lnk) {
-		tmpfs_node_t *nodep;
-		nodep = hash_table_get_inst(lnk, tmpfs_node_t, nh_link);
-		*rfn = FS_NODE(nodep);
-	} else {
+	if (lnk == NULL) {
 		*rfn = NULL;
-	}
+		return EBADF;
+	}
+
+	tmpfs_node_t *nodep;
+	nodep = hash_table_get_inst(lnk, tmpfs_node_t, nh_link);
+	*rfn = FS_NODE(nodep);
 	return EOK;
 }
@@ -320,6 +322,6 @@
 
 	rc = tmpfs_root_get(&rootfn, service_id);
-	assert(rc == EOK);
-	if (!rootfn)
+	assert(rc == EOK || rc == EBADF);
+	if (rootfn == NULL)
 		nodep->index = TMPFS_SOME_ROOT;
 	else
