I have a question about assert() in Linux: can I use it in the kernel?
assert()
If no, what techniques do you usually use if, for example I don\'t want to enter NULL
BUG_ON() is the appropriate approach to do it. It checks for the condition to be true and calls the macro BUG().
BUG_ON()
BUG()
How BUG() handles the rest is explained very well in the following article:
http://kernelnewbies.org/FAQ/BUG