When I try to use malloc in a kernel module I get an error message from the compiler. My code:
malloc
res=(ListNode*)malloc(sizeof(ListNode)); <
res=(ListNode*)malloc(sizeof(ListNode));
use kmalloc or vmalloc instead (see also this)