I'm writting a Linux module (Kernel Programming), and I`m getting:
"Unable to handle kernel NULL pointer dereference"
What does it mean?
I'm writting a Linux module (Kernel Programming), and I`m getting:
"Unable to handle kernel NULL pointer dereference"
What does it mean?
Sounds like a pointer which currently has the NULL value (zero) is being dereferenced. Assign an address to the pointer before dereferencing it.
e.g.
int x = 5;
int * x_ptr = NULL;
x_ptr = &x; // this line may be missing in your code
*x_ptr += 5; //can't dereference x_ptr here if x_ptr is still NULL
The kernel tries to read from address 0
, which your kernel apparently treats specially (good thing!). As the kernel has no way to just kill itself like we know from user mode applications (those would have received a Segmentation Fault), this error is fatal. It will have probably panic'ed and displayed that message to you.
It means the kernel tried to deference a null pointer. This generates a page fault which can't be handled in the kernel- if it's running a user task (but in kernel space), it generally makes an "Oops" which (uncleanly) kills the current task and may leak kernel resources. If it's in some other context, e.g. an interrupt, it generally causes a kernel panic.