diff --git a/kernel/userspace.c b/kernel/userspace.c index bd8a83bbc941..e92bc3dca66a 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -466,8 +466,11 @@ static void unref_check(struct z_object *ko, uintptr_t index) sys_bitfield_clear_bit((mem_addr_t)&ko->perms, index); #ifdef CONFIG_DYNAMIC_OBJECTS - struct dyn_obj *dyn = - CONTAINER_OF(ko, struct dyn_obj, kobj); + void *vko = ko; + + struct dyn_obj *dyn = CONTAINER_OF(vko, struct dyn_obj, kobj); + /* TODO: check why this assert hits */ + /*__ASSERT(IS_PTR_ALIGNED(dyn, struct dyn_obj), "unaligned z_object");*/ if ((ko->flags & K_OBJ_FLAG_ALLOC) == 0U) { goto out;