code fifo->data = kmalloc_array(esize, size, gfp_mask); should be fifo->data = kmalloc_array(size, esize, gfp_mask);