mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
Rationale: we already had a non buildroot build system, maintaining both will be hard, and having short paths is more awesome.
22 lines
369 B
C
22 lines
369 B
C
/* https://github.com/cirosantilli/linux-kernel-module-cheat#kernel-panic-and-oops */
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
|
|
static int myinit(void)
|
|
{
|
|
pr_info("oops myinit\n");
|
|
*(int *)0 = 0;
|
|
pr_info("oops after\n");
|
|
return 0;
|
|
}
|
|
|
|
static void myexit(void)
|
|
{
|
|
pr_info("oops myexit\n");
|
|
}
|
|
|
|
module_init(myinit)
|
|
module_exit(myexit)
|
|
MODULE_LICENSE("GPL");
|