Failure on rmmod

I fail rmmod lcd_module.ko ERROR: Removing "lcd_module": device or resource is busy

lssmod gives me the result: lcd_module [persistent]

How do I cancel this option? I want to download a module more than once for testing.

thank you in advance.

* if I try to install using modprobe, it will not recognize my module.

+4
source share
2 answers

You must implement the module_exit function in your .c file, for example:

 static void __exit myexit(void) {} module_exit(myexit); 

If you have not already done so before loading your module with insmod , then the only way will be removed to remove this module.

+7
source

Alternatively, you can try to force the kernel to remove the module using rmmod -f lcd_module . Warning note. This can lead to a system crash depending on what resources you have in the module and what state it is in when you try to force delete.

0
source

Source: https://habr.com/ru/post/1332942/


All Articles