/* Copy to/from helper functions used in syscall handlers  */
void* k_usermode_alloc_from_copy(const void *src, size_t size)
/* Copy to/from helper functions used in syscall handlers  */
void* k_usermode_alloc_from_copy(const void *src, size_t size)
{
	void *dst = NULL;
	if (K_SYSCALL_MEMORY_READ(src, size)) {
		goto out_err;
	}
	dst = z_thread_malloc(size);
	if (dst == NULL) {
		LOG_ERR("out of thread resource pool memory (%zu)", size);
		goto out_err;
	}
	(void)memcpy(dst, src, size);
out_err:
	return dst;
}