18 4 月 01. kmalloc 宣告記憶體 Powen Ko | CH03 記憶體 | off 宣告記憶體的使用方法 /* Buffer to store data */ char *memory_buffer; int memory_init(void) { /* Allocating memory for the buffer */ memory_buffer = kmalloc(1, GFP_KERNEL); if (!memory_buffer) result = -ENOMEM; }else{ result = 0; } return result; }