kni: allocate memory dynamically for each device