trying to use malloc within a kernel to allocate Chain struct