From f1a730b4d63369233860885b080c2afb875076c3 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 29 Sep 2025 19:57:36 -0400 Subject: kern: ns: Extract true object data from entry Before, the lookup was only returning the object and not the data behind the object itself. Now we extra the data from the object that exists within the hashmap entry. Signed-off-by: Ian Moffett --- src/sys/os/os_ns.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sys/os/os_ns.c') diff --git a/src/sys/os/os_ns.c b/src/sys/os/os_ns.c index 2e0426f..5c1b695 100644 --- a/src/sys/os/os_ns.c +++ b/src/sys/os/os_ns.c @@ -160,6 +160,7 @@ ns_obj_lookup(ns_t ns, const char *name, void *res_p) { uint32_t hash, key; struct ns_hashmap *hm; + struct ns_obj *obj; struct hashmap_entry *entry; if (name == NULL || res_p == NULL) { @@ -179,7 +180,12 @@ ns_obj_lookup(ns_t ns, const char *name, void *res_p) } if (strcmp(entry->name, name) == 0) { - *((void **)res_p) = entry->data; + if ((obj = entry->data) == NULL) + continue; + if (obj->data == NULL) + continue; + + *((void **)res_p) = obj->data; return 0; } -- cgit v1.2.3