I am writing a device driver that, among other things, allocates a block of memory with kmalloc. This memory is freed when the user program closes the file. In one of my experiments, the user program crashed without closing the file.
Will anything free this memory?
In another experiment, I moved kfree()from function close()to function module_exit(). When I ran the user program twice, I called again kmallocwith the same pointer as before, without first freeing it. Thus, I have lost the pointer to this memory and cannot release it.
Is this memory lost for the system until I reboot, or is it freed when the driver unloads?
source
share