I'm writing a Linux module and 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.
http://en.wikipedia.org/wiki/Null_pointer#The_null_pointer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With