I'm having trouble allocating memory is Linux Kernel space. I've created a linked list using the two structs below:
struct Node{
char *ptr;
struct Node *next;
};
struct List{
struct Node *head;
struct Node *tail;
};
Now when I try and allocate a list struct [Edited to reflect proper code]:
struct List *ll = kmalloc(sizeof(struct List), GFP_KERNEL)
I get:
error: Initializer element is not constant
What am I doing wrong here? I want to be add pointers to Nodes in my List struct so would I add them by:
struct Node n* = kmalloc(sizeof(Node));
n -> ptr = "Blah";
n -> next = NULL;
ll -> head = n;