Kernel Memory Allocation (Cont.) Here is an example for a code that allocates a memory page. /* allocate a free memory page. */ unsigned long page = __get_free_page(GFP_KERNEL); if (!page) return -ENOMEM; /* do something with the allocated page... */ . . /* finally, free the allocated page when it is no */ /* longer needed. */ free_page(page);