Feature #2735
open
104: All allocated memory should be freed on module uploading
Added by Evgeny Novikov over 12 years ago.
Updated about 10 years ago.
Description
- At the end all allocated memory should be free.
- It’s not allowed to free the same memory twice.
- It’s not allowed to free not allocated memory.
Description
The dynamic allocation is widely used in Linux. The incorrect usage of heap may lead to memory leaks or even to failures, when the module tries to free not allocated memory. So, the correct usage of heap includes
- Freeing all allocated memory to avoid a memory leak.
- Freeing an allocated memory only once.
- Freeing only allocated memory.
Memory allocation functions are kmalloc and kzalloc, a free function is kfree. It is correct to free the null pointer.
Links
Sample bugfix
Note
This is a generic:resource:leaks class of our classifier.
Files
104_1a.patch (600 Bytes)
104_1a.patch |
Patch to linux-stable kernel to find exactly the same bug as fixed in commit c0cc359 |
Evgeny Novikov, 04/24/2012 02:00 PM
|
|
Commit dd002ee of the master branch adds support of 104_1a model that finds a bug fixed in commit c0cc359 of the linux-stable branch before the fix and... after the fix.
To find exactly the same bug as fixed in commit c0cc359 one should apply the patch attached.
Also simple workaround required to detect the bug was added since commit c71d7a4 of our master branch.
- Subject changed from All allocated memory should be freed on module uploading to 104: All allocated memory should be freed on module uploading
Reduce priority until we'll decide that it's high actually.
- Priority changed from High to Normal
- Description updated (diff)
- Assignee changed from Evgeny Novikov to Pavel Andrianov
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
Also available in: Atom
PDF