From a31024156aebcc2f58d849970efcce50ede58c1c Mon Sep 17 00:00:00 2001
From: Ian Moffett <ian@osmora.org>
Date: Fri, 1 Mar 2024 13:18:37 -0500
Subject: kernel: vfs: Fix logic bug in vfs_hash_path()

Signed-off-by: Ian Moffett <ian@osmora.org>
---
 sys/kern/vfs_subr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 277cf7b..6646f79 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -77,13 +77,13 @@ vfs_hash_path(const char *path)
         return 0;
     }
 
-    while (name != NULL) {
+    do {
         name = vfs_get_fname_at(path, i++);
         if (name != NULL) {
             hash += vfs_hash(name);
             dynfree(name);
         }
-    }
+    } while (name != NULL);
 
     return hash;
 }
-- 
cgit v1.2.3