result = register_chrdev(memory_major, "memory", &memory_fops); if (result < 0) { printk("<1>memory: can't obtain major number %d\n", memory_major); return result; }
memory_buffer = kmalloc(256, GFP_KERNEL); if (!memory_buffer) { result = - ENOMEM; goto fail; } memset(memory_buffer, 0, 256);