Error message not relevant

Nav Kamal navkamal90 at
Wed Nov 20 11:43:26 EST 2013

Am learning to write LKMs and wrote this program :

static int module_entry(void){
        printk(KERN_ALERT "Hello World !!\n");
        return 0;
static void exit_module(void){
        printk(KERN_ALERT "Bye World .... \n");

In this program if I change return value of function module_entry from 0 to
something negative, the module fails to load. The error message is :

"insmod: ERROR: could not insert module test.ko: Operation not permitted"

Failing to load module with negative return value is understandable but I
can't understand why it says "Operation not permitted". Its not about user
permissions, its about return value. Can somebody please guide me about
this ?
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list