diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-29 19:57:36 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-29 19:57:36 -0400 |
commit | f1a730b4d63369233860885b080c2afb875076c3 (patch) | |
tree | 8a59bead41850664582a1611eb9ee3ef6a5b4c01 /src | |
parent | 113a10aed4228819c2f1a2952d692ca1d7488b75 (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/os/os_ns.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |